git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git pull merges current branch even when <dst> is specified

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jun 25, 2009, 08:52 UTC
Message-ID
<4A433AC8.4040702@drmicha.warpmail.net>
In-Reply-To
<1245862052581-3149948.post@n2.nabble.com>
Tom Lambda venit, vidit, dixit 24.06.2009 18:47:
Show 17 quoted lines
> 
> If I am in 'master' and 'bugfix' is a remote branch in 'repo' which I do not
> have locally yet, running:
> 
> git pull repo bugfix:bugfix
> 
> creates a new local branch 'bugfix' equals to 'repo/bugfix' as expected.
> However, it also merges 'bugfix' into 'master', that surprises me since I
> explicitly specify that <dst> is 'bugfix'.
> 
> I know that I can get what I want by running:
> 
> git fetch repo bugfix:bugfix
> 
> But the git-pull behavior looks odd to me. I thought that <dst> was the
> current branch by default and it could be overridden by specifying it in the
> command line.
Well, the first line of git-pull's man page says:

Runs git-fetch with the given parameters, and calls git-merge to merge the retrieved head(s) into the current branch.

So I can't help but call your surprise somewhat unjustified ;)
Michael
Previous: Tom LambdaNext: Johannes Schindelin
Message 2 of 4 in “git pull merges current branch even when <dst> is specified”
  1. Tom LambdaJun 24, 2009
  2. Michael J GruberJun 25, 2009
  3. Johannes SchindelinJun 25, 2009
  4. Tom LambdaJun 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.