remote branch - Git - Change tracking configuration of branches -
i have following branches (local , remote):
origin/master origin/alter origin/alter_old master alter alter_old
if git branch -vv
get:
master 6aec3b5 [origin/master] blam alter 8c32a03 blaa1 alter_old 1669af7 [origin/alter: ahead n, behind m] blaa2
i want alter
track origin/alter
, alter_old
track origin/alter_old
. how can it? tried following:
git checkout alter_old git branch -u origin/alter_old
but get:
error: unknown switch `u'
and same --set-upstream-to
.
edit: strangely, think when push, alter
pushes origin/master
, alter_old
pushed origin/alter_old
. why this?
for git 1.8.0 onwards
git branch alter_old -u origin/alter_old
or
git branch alter_old --set-upstream-to origin/alter_old
for git 1.7.0 : use --set-upstream
instead of --set-upstream-to
git branch --set-upstream alter_old origin/alter_old
Comments
Post a Comment