* git pull question
@ 2010-07-26 1:56 Geoff Russell
2010-07-26 3:43 ` Bradley Wagner
0 siblings, 1 reply; 3+ messages in thread
From: Geoff Russell @ 2010-07-26 1:56 UTC (permalink / raw)
To: git
Hi,
Assuming I already have a branch called brA
$ git checkout master
$ git pull origin refs/heads/brA:brA
The pull here seems to update both the current branch as well as brA?
Is this intentional?
Cheers,
Geoff.
PS. git is at 1.6.2.3
--
6 Fifth Ave,
St Morris, S.A. 5068
Australia
Ph: 041 8805 184 / 08 8332 5069
http://perfidy.com.au
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git pull question
2010-07-26 1:56 git pull question Geoff Russell
@ 2010-07-26 3:43 ` Bradley Wagner
2010-07-26 3:51 ` Geoff Russell
0 siblings, 1 reply; 3+ messages in thread
From: Bradley Wagner @ 2010-07-26 3:43 UTC (permalink / raw)
To: geoffrey.russell; +Cc: git
> Hi,
>
> Assuming I already have a branch called brA
>
> $ git checkout master
> $ git pull origin refs/heads/brA:brA
>
> The pull here seems to update both the current branch as well as brA?
> Is this intentional?
I believe this is intentional.
A git pull always pulls into (at least) the currently checked out
branch, in your case "master". By adding the <dst> param after the
colon in the <refspec> you're saying to go ahead and fast-forward
merge the local branch called "brA" if possible.
This is almost equivalent to saying:
git checkout brA
git pull origin brA
git checkout master
git pull origin brA
assuming everything can be fast-forward merged.
Read the the portion of git-pull man entry regarding the <refspec> for
a more thorough explanation:
http://www.kernel.org/pub/software/scm/git/docs/git-pull.html
However, I'm not entirely clear myself on the meaning of this note in
the documentation:
Note
You never do your own development on branches that appear on the right
hand side of a <refspec> colon on Pull: lines; they are to be updated
by git fetch. If you intend to do development derived from a remote
branch B, have a Pull: line to track it (i.e. Pull: B:remote-B), and
have a separate branch my-B to do your development on top of it. The
latter is created by git branch my-B remote-B (or its equivalent git
checkout -b my-B remote-B). Run git fetch to keep track of the
progress of the remote side, and when you see something new on the
remote branch, merge it into your development branch with git pull .
remote-B, while you are on my-B branch.
>
> Cheers,
> Geoff.
>
> PS. git is at 1.6.2.3
>
> --
> 6 Fifth Ave,
> St Morris, S.A. 5068
> Australia
> Ph: 041 8805 184 / 08 8332 5069
> http://perfidy.com.au
> --
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git pull question
2010-07-26 3:43 ` Bradley Wagner
@ 2010-07-26 3:51 ` Geoff Russell
0 siblings, 0 replies; 3+ messages in thread
From: Geoff Russell @ 2010-07-26 3:51 UTC (permalink / raw)
To: Bradley Wagner; +Cc: git
On Mon, Jul 26, 2010 at 1:13 PM, Bradley Wagner
<bradley.wagner@hannonhill.com> wrote:
>> ...
>> $ git checkout master
>> $ git pull origin refs/heads/brA:brA
>>
>> The pull here seems to update both the current branch as well as brA?
>> Is this intentional?
>
> I believe this is intentional.
>
> A git pull always pulls into (at least) the currently checked out
> branch, in your case "master". By adding the <dst> param after the
> colon in the <refspec> you're saying to go ahead and fast-forward
> merge the local branch called "brA" if possible.
Okay.
> However, I'm not entirely clear myself on the meaning of this note in
> the documentation:
>
> Note
> You never do your own development on branches that appear on the right
> hand side of a <refspec> colon on Pull: lines; they are to be updated
> by git fetch. If you intend to do development derived from a remote
> branch B, have a Pull: line to track it (i.e. Pull: B:remote-B), and
> have a separate branch my-B to do your development on top of it. The
> latter is created by git branch my-B remote-B (or its equivalent git
> checkout -b my-B remote-B). Run git fetch to keep track of the
> progress of the remote side, and when you see something new on the
> remote branch, merge it into your development branch with git pull .
> remote-B, while you are on my-B branch.
Yes, I was wondering about this ... I can't see any downside
Geoff.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-26 3:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-26 1:56 git pull question Geoff Russell
2010-07-26 3:43 ` Bradley Wagner
2010-07-26 3:51 ` Geoff Russell
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 NNTP newsgroup(s).