Is also equivalent to git checkout -b branch -track origin/branch if “branch” does not exist yet but “origin/branch” does 1.Īll three commands set the “upstream” of “branch” to be “origin/branch” (or they fail). In effect, 2) behaves like git checkout -b branch -track origin/branch. The guessing is driven by the configuration variable. “As a convenience”, -track without -b implies -b and the argument to -b is guessed to be “branch”. In effect, 1) behaves like git checkout -b branch -track origin/branch. The default can be changed with the setting tosetupmerge. If there is no -track and no -no-track, -track is assumed as default. See " How do you make an existing git branch track a remote branch?" for more. directs git pull without arguments to pull from the upstream when the new branch is checked out.tell git to show the relationship between the two branches in git status and git branch -v.Having an upstream branch registered for a local branch will: (Note: git1.8.0 will deprecate git branch -set-upstream and replace it with git branch -u|-set-upstream-to: see git1.8.0-rc1 announce) It would also set the upstream for ' branch'. Git branch -set-upstream-to upstream/branch branch Git branch -set-upstream upstream/branch branch That setting can be overridden by using the -track and -no-track options, and changed later using git branch -set-upstream-to.Īnd git checkout -track origin/branch will do the same as git branch -set-upstream-to): # or, since 1.7.0 This behavior may be changed via the global tosetupmerge configuration flag. When a local branch is started off a remote-tracking branch, Git sets up the branch (specifically the branch.remote and rge configuration entries) so that git pull will appropriately merge from the remote-tracking branch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |