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
| Parag Warudkar | BUG: soft lockup - CPU#1 stuck for 15s! [swapper:0] |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 010/196] Chinese: add translation of Codingstyle |
| Andrew Morton | -mm merge plans for 2.6.23 |
git: | |
| Gerrit Renker | [PATCH 24/37] dccp: Processing Confirm options |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Alexey Dobriyan | Re: [GIT]: Networking |
| david | Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49 |
