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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, 25 Jun 2009, Michael J Gruber wrote:

> Tom Lambda venit, vidit, dixit 24.06.2009 18:47:
> > 
> > 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.

To explain why this is so: Merging is an operation that requires a working 
directory, as merge conflicts can happen.  That is why merging is only 
possible locally, and only into the current branch.

Ciao,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]