2011年4月14日 星期四

make an existing git branch track a remote branch

如果當初 就是 checkout remote branch 出來,那個 branch 會自動設定 upstream 是 remote branch.
所以 push, pull 都會對應到 這個 upstream (remote branch)

但是如過自己這個 branch 是 local create,之後卻要設定他的 upstream 是某一個 remote branch 的話..
$ git branch --set-upstream localbranchname remotename/branchname
這樣就可以設定自己這邊的 localbranchname 的 upstream 是 remotename/branchname.


ref : http://stackoverflow.com/questions/520650/how-do-you-make-an-existing-git-branch-track-a-remote-branch

沒有留言:

張貼留言