On Sat, 04 Aug 2007 12:55:43 +0200 David Kastrup <dak@gnu.org> wrote:Yes. To be clear, it's the job of git-fetch to update remote-tracking branches with any changes found in the remote repository. Git-pull runs git-fetch and then runs a git-merge to update the currently-checked-out branch. When this happens, git-merge must decide which remote-tracking-branch to merge into the currently checked out local branch. You can set which remote-tracking-branch will be selected in this situation with the --track option. So assuming a remote-repo has two branches "master" and "branchX": git clone remote-repo will give us two remote-branch (AKA remote-tracking-branches) of "origin/master" and "origin/branchX". So: git branch --track mylocalbranch origin/branchX git checkout mylocalbranch Creates a local branch named "mylocalbranch" that by default will merge in any changes found in the remote-tracking branch "origin/branchX". Thus: git pull First runs git fetch which will update all remote-tracking branches such as origin/master and origin/branchX. Then it runs git merge. Git merge has to decide whether to merge in the changes from origin/master or origin/branchX. Because of the --track option used to setup "mylocalbranch", "origin/branchX" will be merged. No, a local branch is never a remote-tracking branch; even when created with a --track option. The --track option has muddied the terminology waters a bit and you're not the first to be confused by it. The --track selects a branch from the repo to merge by default. Functionally, your understanding is correct. But it helps when you understand that remote-branches are the "real" remote-tracking-branches. You don't commit to them locally, they are essentially read-only copies of exactly what is happening in a remote repository. A local --track branch, is one that merges changes from the proper remote-tracking-branch, and is also a place where you can commit your own work. A remote branch and a remote-tracking branch are the same thing. Strictly speaking a local branch is never a remote-tracking-branch although the "--track" option makes that harder to explain. Yeah, the documentation could use some fine tuning. Sean - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Linus Torvalds | Linux 2.6.27-rc5 |
| Greg Kroah-Hartman | [PATCH 007/196] Chinese: add translation of stable_kernel_rules.txt |
| Kamalesh Babulal | [Build Failure] 2.6.25-rc5-mm1 Build fails with allmodconfig probe_4drives undefined |
| Gabriel C | Re: Linus 2.6.23-rc1 |
| David Woodhouse | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
git: | |
