Git: setting a local branch's upstream tracking branch

How to set a local branch's upstream tracking branch in git? For example, I want to track remote repository 'origin' 's branch 'demo' with the local 'demo' branch.

asked Jan 23, 2013 by anonymous

1 Answer

 
Best answer

You can set tracking information for the current branch (say cur_branch) of upstream branch (say also cur_branch) in remote repository origin with:

git branch --set-upstream cur_branch origin/cur_branch
answered Jan 24, 2013 by anonymous
selected Jan 24, 2013 by SA

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...