From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Tom Lambda <tom.lambda@gmail.com>, git@vger.kernel.org
Subject: Re: git pull merges current branch even when <dst> is specified
Date: Thu, 25 Jun 2009 11:44:17 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.1.00.0906251142550.5365@intel-tinevez-2-302> (raw)
In-Reply-To: <4A433AC8.4040702@drmicha.warpmail.net>
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
next prev parent reply other threads:[~2009-06-25 9:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-24 16:47 git pull merges current branch even when <dst> is specified Tom Lambda
2009-06-25 8:52 ` Michael J Gruber
2009-06-25 9:44 ` Johannes Schindelin [this message]
2009-06-25 13:28 ` Tom Lambda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.1.00.0906251142550.5365@intel-tinevez-2-302 \
--to=johannes.schindelin@gmx.de \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=tom.lambda@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).