Faire un existant Git branch track a remote branch

Mots clés : gitbranchgit-branchgit

meilleur 5 Réponses Faire un existant Git branch track a remote branch

vote vote

92

git branch -u upstream/foo 
git branch -u upstream/foo foo 
git branch --set-upstream-to=upstream/foo  git branch --set-upstream-to=upstream/foo foo 
git branch --set-upstream foo upstream/foo 
vote vote

90

git remote add origin ssh://... 
git config branch.master.remote origin git config branch.master.merge refs/heads/master 
git push origin master 
vote vote

77

$ git push -u origin branch-name 
$ git branch foo $ git branch --set-upstream-to=origin/foo 
$ git branch --set-upstream-to=origin/foo foo 
vote vote

67

git remote add upstream <remote-url> git fetch upstream git branch -f --track qa upstream/qa # OR Git version 1.8.0 and higher: git branch --set-upstream-to=upstream/qa # Gitversions lower than 1.8.0 git branch --set-upstream qa upstream/qa 
vote vote

52

grb explain create my_branch github # git_remote_branch version 0.3.0  # List of operations to do to create a new remote branch and track it locally: git push github master:refs/heads/my_branch git fetch github git branch --track my_branch github/my_branch git checkout my_branch 

Questions similaires