<div dir="ltr"><div><font color="#000">Ben and Eliot, just in case you missed Jacobs answer to the git pull -a question (which you both seem to be confused about)</font></div><div><br></div><div><div dir="ltr">On Fri, 2 Jun 2017 at 10:00 Jakob Reschke <<a href="mailto:jakob.reschke@student.hpi.de">jakob.reschke@student.hpi.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> 2017-06-02 1:36 GMT+02:00 Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>>:<br>> <br>...<br>> <br>> The commit is related to a graph of previous commits, right?  So a branch<br>> implies a distinct set of commits, right?  When one merges from a branch,<br>> the commits on the branch don't get added to the target into which one<br>> merges do they  Isn't that the difference between pull and pull -a, that<br>> the former just pulls commits on a single branch while pull -a p;pulls<br>> commits on all branches?<br><br> Git commits refer to their parent commits (merge commits have more<br> than one parent), but do not store on which branch(es) they are or<br> were on. Since a branch is just a reference (to a commit), you may<br> talk about the commits that are reachable from a branch (it is what<br> you get from "git log branchname"). But this set almost always<br> overlaps with that of other branches because of all the common<br> ancestor commits.<br><br> Merging a branch adds an additional parent to the to-be-created merge<br> commit. Thus, the commits from the merged branch become reachable from<br> the branch into which you are merging. So, in a way, they do get added<br> to the merge target.<br><br> pull -a does not "pull on all branches" and does not usually affect<br> the result of the merge at all. "git pull <remote> <branch>"<br> essentially means "git fetch <remote> <branch>", which writes the<br> fetched commits to a temporary reference called FETCH_HEAD, followed<br> by "git merge FETCH_HEAD". The -a stands for --append, is an option<br> for the fetch, and means that instead of overwriting what is in<br> .git/FETCH_HEAD, append the newly fetched commits there. But "git<br> merge FETCH_HEAD" will only use the top commit from that file anyway,<br> so this is kind of pointless for pull. In fact, it might lead to<br> merging the wrong branch or not merging anything at all because the<br> latest fetched commit with -a goes to the end of FETCH_HEAD, not the<br> top.<br><br> But even if it meant to "pull commits on all branches", why would that<br> be useful? When you work and pull on branch/feature X, why would you<br> want to invoke a merge on an unrelated branch/feature Y?<br><br> If you wanted to merge more than one upstream branch into your current<br> branch, you would have to name them all when pulling:<br><br>    git pull origin branch1 branch2 ...<br><br> ...which attempts a merge with (1 + number of unmerged upstream<br> branches named on the command line) parent commits.<br><br></blockquote></div></div>