git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* branch ahead in commits but push claims all up to date
       [not found] <7001b7a00903240821v2155d234x6a10c80a3e987acb@mail.gmail.com>
@ 2009-03-24 15:22 ` Irene Ros
  2009-03-24 16:12   ` Junio C Hamano
  2009-03-24 16:18   ` John Tapsell
  0 siblings, 2 replies; 13+ messages in thread
From: Irene Ros @ 2009-03-24 15:22 UTC (permalink / raw)
  To: git

Hi all,

I've been using git for some time now and haven't run into this issue
before, perhaps someone else here has:

I have a branch that is ahead of its origin by a few commits:

$ git status
# On branch myBranch
# Your branch is ahead of 'origin/myBranch' by 10 commits.

Oddly, when I try to do a push, I get a message saying that everything
is up to date:
$ git push origin myBranch
Everything up-to-date

Looking at the log for origin/myBranch I can tell those commits are
missing, but I can't push them up, even with a --force flag. Any
ideas?
Here's the config entry for this branch:

[branch "myBranch"]
    remote = origin
    merge = refs/heads/myBranch

There's also nothing to pull from this branch, I'm the only one working on it.
I use many other branches in this particular repo, and its just this
one that's giving me trouble.

Thanks so much!
-- Irene

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-24 15:22 ` branch ahead in commits but push claims all up to date Irene Ros
@ 2009-03-24 16:12   ` Junio C Hamano
  2009-03-24 16:18   ` John Tapsell
  1 sibling, 0 replies; 13+ messages in thread
From: Junio C Hamano @ 2009-03-24 16:12 UTC (permalink / raw)
  To: Irene Ros; +Cc: git

Irene Ros <imirene@gmail.com> writes:

> Hi all,
>
> I've been using git for some time now and haven't run into this issue
> before, perhaps someone else here has:
>
> I have a branch that is ahead of its origin by a few commits:
>
> $ git status
> # On branch myBranch
> # Your branch is ahead of 'origin/myBranch' by 10 commits.
>
> Oddly, when I try to do a push, I get a message saying that everything
> is up to date:
> $ git push origin myBranch
> Everything up-to-date
>
> Looking at the log for origin/myBranch I can tell those commits are
> missing, but I can't push them up, even with a --force flag. Any
> ideas?
> Here's the config entry for this branch:
>
> [branch "myBranch"]
>     remote = origin
>     merge = refs/heads/myBranch

How does your

	[remote "origin"]

part look like?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-24 15:22 ` branch ahead in commits but push claims all up to date Irene Ros
  2009-03-24 16:12   ` Junio C Hamano
@ 2009-03-24 16:18   ` John Tapsell
  2009-03-24 17:13     ` Daniel Barkalow
  1 sibling, 1 reply; 13+ messages in thread
From: John Tapsell @ 2009-03-24 16:18 UTC (permalink / raw)
  To: Irene Ros; +Cc: git

2009/3/24 Irene Ros <imirene@gmail.com>:
> Hi all,
>
> I've been using git for some time now and haven't run into this issue
> before, perhaps someone else here has:
>
> I have a branch that is ahead of its origin by a few commits:
>
> $ git status
> # On branch myBranch
> # Your branch is ahead of 'origin/myBranch' by 10 commits.

Tried running: git fetch   ?

For some weird reason  "git push origin mybranch"  doesn't actually
update origin/mybranch.  It's more annoying :-)

John

> Oddly, when I try to do a push, I get a message saying that everything
> is up to date:
> $ git push origin myBranch
> Everything up-to-date
>
> Looking at the log for origin/myBranch I can tell those commits are
> missing, but I can't push them up, even with a --force flag. Any
> ideas?
> Here's the config entry for this branch:
>
> [branch "myBranch"]
>     remote = origin
>     merge = refs/heads/myBranch
>
> There's also nothing to pull from this branch, I'm the only one working on it.
> I use many other branches in this particular repo, and its just this
> one that's giving me trouble.
>
> Thanks so much!
> -- Irene
> --
> 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] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-24 16:18   ` John Tapsell
@ 2009-03-24 17:13     ` Daniel Barkalow
  2009-03-25  0:26       ` John Tapsell
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Barkalow @ 2009-03-24 17:13 UTC (permalink / raw)
  To: John Tapsell; +Cc: Irene Ros, git

On Tue, 24 Mar 2009, John Tapsell wrote:

> 2009/3/24 Irene Ros <imirene@gmail.com>:
> > Hi all,
> >
> > I've been using git for some time now and haven't run into this issue
> > before, perhaps someone else here has:
> >
> > I have a branch that is ahead of its origin by a few commits:
> >
> > $ git status
> > # On branch myBranch
> > # Your branch is ahead of 'origin/myBranch' by 10 commits.
> 
> Tried running: git fetch   ?
> 
> For some weird reason  "git push origin mybranch"  doesn't actually
> update origin/mybranch.  It's more annoying :-)

It should, so long as you're using the native transport and 
origin/mybranch actually tracks mybranch on origin.

"git push" doesn't update it, but the code that implements the native 
transport does update it if it succeeds.

(Actually, I'm not 100% sure that, if you update origin through some other 
channel with exactly the commit that you now have in mybranch locally, and 
then try the push, it will update the local tracking for that branch; is 
that what you've hit?)

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-24 17:13     ` Daniel Barkalow
@ 2009-03-25  0:26       ` John Tapsell
  2009-03-25  1:24         ` Daniel Barkalow
  0 siblings, 1 reply; 13+ messages in thread
From: John Tapsell @ 2009-03-25  0:26 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: Irene Ros, git

2009/3/24 Daniel Barkalow <barkalow@iabervon.org>:
> On Tue, 24 Mar 2009, John Tapsell wrote:
>
>> 2009/3/24 Irene Ros <imirene@gmail.com>:
>> > Hi all,
>> >
>> > I've been using git for some time now and haven't run into this issue
>> > before, perhaps someone else here has:
>> >
>> > I have a branch that is ahead of its origin by a few commits:
>> >
>> > $ git status
>> > # On branch myBranch
>> > # Your branch is ahead of 'origin/myBranch' by 10 commits.
>>
>> Tried running: git fetch   ?
>>
>> For some weird reason  "git push origin mybranch"  doesn't actually
>> update origin/mybranch.  It's more annoying :-)
>
> It should, so long as you're using the native transport and
> origin/mybranch actually tracks mybranch on origin.
>
> "git push" doesn't update it, but the code that implements the native
> transport does update it if it succeeds.
>
> (Actually, I'm not 100% sure that, if you update origin through some other
> channel with exactly the commit that you now have in mybranch locally, and
> then try the push, it will update the local tracking for that branch; is
> that what you've hit?)

I update via http - maybe that's why?  origin/mybranch is never
updated when I push.  It's not just a once-off quirk.

John

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-25  0:26       ` John Tapsell
@ 2009-03-25  1:24         ` Daniel Barkalow
  2009-03-25  2:01           ` Irene Ros
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Barkalow @ 2009-03-25  1:24 UTC (permalink / raw)
  To: John Tapsell; +Cc: Irene Ros, git

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1794 bytes --]

On Wed, 25 Mar 2009, John Tapsell wrote:

> 2009/3/24 Daniel Barkalow <barkalow@iabervon.org>:
> > On Tue, 24 Mar 2009, John Tapsell wrote:
> >
> >> 2009/3/24 Irene Ros <imirene@gmail.com>:
> >> > Hi all,
> >> >
> >> > I've been using git for some time now and haven't run into this issue
> >> > before, perhaps someone else here has:
> >> >
> >> > I have a branch that is ahead of its origin by a few commits:
> >> >
> >> > $ git status
> >> > # On branch myBranch
> >> > # Your branch is ahead of 'origin/myBranch' by 10 commits.
> >>
> >> Tried running: git fetch   ?
> >>
> >> For some weird reason  "git push origin mybranch"  doesn't actually
> >> update origin/mybranch.  It's more annoying :-)
> >
> > It should, so long as you're using the native transport and
> > origin/mybranch actually tracks mybranch on origin.
> >
> > "git push" doesn't update it, but the code that implements the native
> > transport does update it if it succeeds.
> >
> > (Actually, I'm not 100% sure that, if you update origin through some other
> > channel with exactly the commit that you now have in mybranch locally, and
> > then try the push, it will update the local tracking for that branch; is
> > that what you've hit?)
> 
> I update via http - maybe that's why?  origin/mybranch is never
> updated when I push.  It's not just a once-off quirk.

Yup, http doesn't have it. One of my series currently in next moves it 
from the git-specific protocol to the common code, but there's still work 
to be done to allow the http push transport to report back to the common 
code what got updated successfully, which is largely a matter of making 
the http-push code run in-process instead of as a command run by 
transport.c, and using the just-added API.

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-25  1:24         ` Daniel Barkalow
@ 2009-03-25  2:01           ` Irene Ros
  2009-03-25  2:13             ` John Tapsell
  2009-03-25  3:19             ` Daniel Barkalow
  0 siblings, 2 replies; 13+ messages in thread
From: Irene Ros @ 2009-03-25  2:01 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: John Tapsell, git

Hi All,

Thank you for the good advice. I may be the case I am somehow misusing
git... I couldn't resolve the issue and so I created a new project off
of the same repo. Switching to the same branch in question yielded an
even stranger result: In this new project, the commits were there (I
could see them in git log and in git log origin/myBranch) whereas in
the previous older project I did not... does that make sense? Our
origin branches are located on a central server so can't quite figure
out why viewing the log of the same remote branch from two different
projects would yield different results. Any suggestions? At this
point, I'm just really curious.

-- Irene



On Tue, Mar 24, 2009 at 9:24 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:
> On Wed, 25 Mar 2009, John Tapsell wrote:
>
>> 2009/3/24 Daniel Barkalow <barkalow@iabervon.org>:
>> > On Tue, 24 Mar 2009, John Tapsell wrote:
>> >
>> >> 2009/3/24 Irene Ros <imirene@gmail.com>:
>> >> > Hi all,
>> >> >
>> >> > I've been using git for some time now and haven't run into this issue
>> >> > before, perhaps someone else here has:
>> >> >
>> >> > I have a branch that is ahead of its origin by a few commits:
>> >> >
>> >> > $ git status
>> >> > # On branch myBranch
>> >> > # Your branch is ahead of 'origin/myBranch' by 10 commits.
>> >>
>> >> Tried running: git fetch   ?
>> >>
>> >> For some weird reason  "git push origin mybranch"  doesn't actually
>> >> update origin/mybranch.  It's more annoying :-)
>> >
>> > It should, so long as you're using the native transport and
>> > origin/mybranch actually tracks mybranch on origin.
>> >
>> > "git push" doesn't update it, but the code that implements the native
>> > transport does update it if it succeeds.
>> >
>> > (Actually, I'm not 100% sure that, if you update origin through some other
>> > channel with exactly the commit that you now have in mybranch locally, and
>> > then try the push, it will update the local tracking for that branch; is
>> > that what you've hit?)
>>
>> I update via http - maybe that's why?  origin/mybranch is never
>> updated when I push.  It's not just a once-off quirk.
>
> Yup, http doesn't have it. One of my series currently in next moves it
> from the git-specific protocol to the common code, but there's still work
> to be done to allow the http push transport to report back to the common
> code what got updated successfully, which is largely a matter of making
> the http-push code run in-process instead of as a command run by
> transport.c, and using the just-added API.
>
>        -Daniel
> *This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-25  2:01           ` Irene Ros
@ 2009-03-25  2:13             ` John Tapsell
  2009-03-25  3:19             ` Daniel Barkalow
  1 sibling, 0 replies; 13+ messages in thread
From: John Tapsell @ 2009-03-25  2:13 UTC (permalink / raw)
  To: Irene Ros; +Cc: Daniel Barkalow, git

2009/3/25 Irene Ros <imirene@gmail.com>:
> Hi All,
>
> Thank you for the good advice. I may be the case I am somehow misusing

So, did you actually try:

git fetch

?

> git... I couldn't resolve the issue and so I created a new project off
> of the same repo. Switching to the same branch in question yielded an
> even stranger result: In this new project, the commits were there (I
> could see them in git log and in git log origin/myBranch) whereas in
> the previous older project I did not... does that make sense? Our
> origin branches are located on a central server so can't quite figure
> out why viewing the log of the same remote branch from two different
> projects would yield different results. Any suggestions? At this
> point, I'm just really curious.
>
> -- Irene
>
>
>
> On Tue, Mar 24, 2009 at 9:24 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:
>> On Wed, 25 Mar 2009, John Tapsell wrote:
>>
>>> 2009/3/24 Daniel Barkalow <barkalow@iabervon.org>:
>>> > On Tue, 24 Mar 2009, John Tapsell wrote:
>>> >
>>> >> 2009/3/24 Irene Ros <imirene@gmail.com>:
>>> >> > Hi all,
>>> >> >
>>> >> > I've been using git for some time now and haven't run into this issue
>>> >> > before, perhaps someone else here has:
>>> >> >
>>> >> > I have a branch that is ahead of its origin by a few commits:
>>> >> >
>>> >> > $ git status
>>> >> > # On branch myBranch
>>> >> > # Your branch is ahead of 'origin/myBranch' by 10 commits.
>>> >>
>>> >> Tried running: git fetch   ?
>>> >>
>>> >> For some weird reason  "git push origin mybranch"  doesn't actually
>>> >> update origin/mybranch.  It's more annoying :-)
>>> >
>>> > It should, so long as you're using the native transport and
>>> > origin/mybranch actually tracks mybranch on origin.
>>> >
>>> > "git push" doesn't update it, but the code that implements the native
>>> > transport does update it if it succeeds.
>>> >
>>> > (Actually, I'm not 100% sure that, if you update origin through some other
>>> > channel with exactly the commit that you now have in mybranch locally, and
>>> > then try the push, it will update the local tracking for that branch; is
>>> > that what you've hit?)
>>>
>>> I update via http - maybe that's why?  origin/mybranch is never
>>> updated when I push.  It's not just a once-off quirk.
>>
>> Yup, http doesn't have it. One of my series currently in next moves it
>> from the git-specific protocol to the common code, but there's still work
>> to be done to allow the http push transport to report back to the common
>> code what got updated successfully, which is largely a matter of making
>> the http-push code run in-process instead of as a command run by
>> transport.c, and using the just-added API.
>>
>>        -Daniel
>> *This .sig left intentionally blank*
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-25  2:01           ` Irene Ros
  2009-03-25  2:13             ` John Tapsell
@ 2009-03-25  3:19             ` Daniel Barkalow
  2009-03-25 17:23               ` Irene Ros
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel Barkalow @ 2009-03-25  3:19 UTC (permalink / raw)
  To: Irene Ros; +Cc: John Tapsell, git

On Tue, 24 Mar 2009, Irene Ros wrote:

> Hi All,
> 
> Thank you for the good advice. I may be the case I am somehow misusing
> git... I couldn't resolve the issue and so I created a new project off
> of the same repo. Switching to the same branch in question yielded an
> even stranger result: In this new project, the commits were there (I
> could see them in git log and in git log origin/myBranch) whereas in
> the previous older project I did not... does that make sense? Our
> origin branches are located on a central server so can't quite figure
> out why viewing the log of the same remote branch from two different
> projects would yield different results. Any suggestions? At this
> point, I'm just really curious.

origin/* is a copy of what git saw the last time it talked to the remote 
repository. This may be different from what the remote repository now 
contains. (Also, there are a few cases in which pushing to a remote 
repository doesn't count as talking to it; fetching with a configured 
remote always counts.) The local copies are handy for being able to 
compare the work you've done locally with what is in the remote repository 
when you don't necessarily have a network connection, don't expect 
constant updates remotely, or don't want to be distracted by remote 
changes. For example, you might have your local work, and you might want 
to compare it with what other people have done. You want to avoid having 
additional changes that other people make while you're making this 
comparison show up in the middle.

Of course, when you make a new clone of the same repository, this clone 
will look at the repository when you make the clone, and will have the 
latest information (as of that time). 

In order to get an existing repository to see changes to a remote 
repository, use "git fetch <remote>" (you can leave off the <remote> to 
get the oone you gave to "clone", which is configured as "origin"). 
Alternatively, you can use "git pull" to get the data and also merge it in 
the same command, which may or may not be a useful addition depending on 
your workflow.

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-25  3:19             ` Daniel Barkalow
@ 2009-03-25 17:23               ` Irene Ros
  2009-03-25 17:32                 ` Santi Béjar
  2009-03-26  2:05                 ` John Tapsell
  0 siblings, 2 replies; 13+ messages in thread
From: Irene Ros @ 2009-03-25 17:23 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: John Tapsell, git

Hi Daniel,

Thank you for the explanation, doing a git fetch actually did do the
trick although I still don't quite see the difference between
git pull origin myBranch
and
git fetch

When I push to origin myBranch it's clear that it actually pushes my
changes to our remote repository since others can then pull and get
them. So is it the case that:

git push ==> actual remote repository
while
git pull <== local copy of remote repository for this branch ?

In that case why is it that in all branches that I have, besides this
one, doing a 'git pull origin whateverBranch' actually pulls from the
remote branch and not the local copy? This case has been quite unique
given dozens of branches that we constantly switch to and from. We've
never actually used (or clearly saw the need for) git fetch until now.

Thank you so much for your insight, it's very helpful in understanding
these subtleties.

-- Irene



On Tue, Mar 24, 2009 at 11:19 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:
> On Tue, 24 Mar 2009, Irene Ros wrote:
>
>> Hi All,
>>
>> Thank you for the good advice. I may be the case I am somehow misusing
>> git... I couldn't resolve the issue and so I created a new project off
>> of the same repo. Switching to the same branch in question yielded an
>> even stranger result: In this new project, the commits were there (I
>> could see them in git log and in git log origin/myBranch) whereas in
>> the previous older project I did not... does that make sense? Our
>> origin branches are located on a central server so can't quite figure
>> out why viewing the log of the same remote branch from two different
>> projects would yield different results. Any suggestions? At this
>> point, I'm just really curious.
>
> origin/* is a copy of what git saw the last time it talked to the remote
> repository. This may be different from what the remote repository now
> contains. (Also, there are a few cases in which pushing to a remote
> repository doesn't count as talking to it; fetching with a configured
> remote always counts.) The local copies are handy for being able to
> compare the work you've done locally with what is in the remote repository
> when you don't necessarily have a network connection, don't expect
> constant updates remotely, or don't want to be distracted by remote
> changes. For example, you might have your local work, and you might want
> to compare it with what other people have done. You want to avoid having
> additional changes that other people make while you're making this
> comparison show up in the middle.
>
> Of course, when you make a new clone of the same repository, this clone
> will look at the repository when you make the clone, and will have the
> latest information (as of that time).
>
> In order to get an existing repository to see changes to a remote
> repository, use "git fetch <remote>" (you can leave off the <remote> to
> get the oone you gave to "clone", which is configured as "origin").
> Alternatively, you can use "git pull" to get the data and also merge it in
> the same command, which may or may not be a useful addition depending on
> your workflow.
>
>        -Daniel
> *This .sig left intentionally blank*
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-25 17:23               ` Irene Ros
@ 2009-03-25 17:32                 ` Santi Béjar
  2009-03-26  2:05                 ` John Tapsell
  1 sibling, 0 replies; 13+ messages in thread
From: Santi Béjar @ 2009-03-25 17:32 UTC (permalink / raw)
  To: Irene Ros; +Cc: Daniel Barkalow, John Tapsell, git

2009/3/25 Irene Ros <imirene@gmail.com>:
> Hi Daniel,
>
> Thank you for the explanation, doing a git fetch actually did do the
> trick although I still don't quite see the difference between
> git pull origin myBranch

This fetches myBranch from origin, and merges with the current branch.

> and
> git fetch

This fetches and *saves* the configured branches (all by default) from
the configured remote (origin by default).

>
> When I push to origin myBranch it's clear that it actually pushes my
> changes to our remote repository since others can then pull and get
> them. So is it the case that:
>
> git push ==> actual remote repository
> while
> git pull <== local copy of remote repository for this branch ?

I don't know if I understand correctly, but pull always uses the
branches from the remote repository, but depending on how you call it
it will also update the local copy (origin/*).

HTH,
Santi

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-25 17:23               ` Irene Ros
  2009-03-25 17:32                 ` Santi Béjar
@ 2009-03-26  2:05                 ` John Tapsell
  2009-03-26 12:48                   ` Björn Steinbrink
  1 sibling, 1 reply; 13+ messages in thread
From: John Tapsell @ 2009-03-26  2:05 UTC (permalink / raw)
  To: Irene Ros; +Cc: Daniel Barkalow, git

2009/3/25 Irene Ros <imirene@gmail.com>:
> Hi Daniel,
>
> Thank you for the explanation, doing a git fetch actually did do the
> trick although I still don't quite see the difference between
> git pull origin myBranch
> and
> git fetch

git pull origin myBranch    is equivalent to two commands:

git fetch
git merge origin/myBranch

(so fetch actual remote repository to local remote repository.  Then
do the merge)

>
> When I push to origin myBranch it's clear that it actually pushes my
> changes to our remote repository since others can then pull and get
> them. So is it the case that:
>
> git push ==> actual remote repository
Yes

> while
> git pull <== local copy of remote repository for this branch ?

git pull <== actual remote repository copied to local copy of remote
repository.  Then local copy of remote repository merged into your
branch.


> In that case why is it that in all branches that I have, besides this
> one, doing a 'git pull origin whateverBranch' actually pulls from the
> remote branch and not the local copy? This case has been quite unique
> given dozens of branches that we constantly switch to and from. We've
> never actually used (or clearly saw the need for) git fetch until now.


If you always git pull  after git push, then you'll have no problem,
since git pull also does a git fetch.

git is sometimes a bit too bare bones :-/  It would be nice to try to
hide these implementation details better

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: branch ahead in commits but push claims all up to date
  2009-03-26  2:05                 ` John Tapsell
@ 2009-03-26 12:48                   ` Björn Steinbrink
  0 siblings, 0 replies; 13+ messages in thread
From: Björn Steinbrink @ 2009-03-26 12:48 UTC (permalink / raw)
  To: John Tapsell; +Cc: Irene Ros, Daniel Barkalow, git

On 2009.03.26 02:05:21 +0000, John Tapsell wrote:
> 2009/3/25 Irene Ros <imirene@gmail.com>:
> > Thank you for the explanation, doing a git fetch actually did do the
> > trick although I still don't quite see the difference between
> > git pull origin myBranch
> > and
> > git fetch
> 
> git pull origin myBranch    is equivalent to two commands:
> 
> git fetch
> git merge origin/myBranch

No. If that was the case, the remote tracking branches would be updated
by the "git fetch" part. And there wouldn't be a difference between the
two commands WRT the handling of remote tracking branches.

git pull origin myBranch does something like:

git fetch origin myBranch
git merge FETCH_HEAD

The remote and the refspec are passed to "git fetch" by "git pull".
So because there's an explicit refspec, the default value from the
config is not used. And because the refspec has no right side, things
get stored to FETCH_HEAD.

Björn

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-03-26 13:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <7001b7a00903240821v2155d234x6a10c80a3e987acb@mail.gmail.com>
2009-03-24 15:22 ` branch ahead in commits but push claims all up to date Irene Ros
2009-03-24 16:12   ` Junio C Hamano
2009-03-24 16:18   ` John Tapsell
2009-03-24 17:13     ` Daniel Barkalow
2009-03-25  0:26       ` John Tapsell
2009-03-25  1:24         ` Daniel Barkalow
2009-03-25  2:01           ` Irene Ros
2009-03-25  2:13             ` John Tapsell
2009-03-25  3:19             ` Daniel Barkalow
2009-03-25 17:23               ` Irene Ros
2009-03-25 17:32                 ` Santi Béjar
2009-03-26  2:05                 ` John Tapsell
2009-03-26 12:48                   ` Björn Steinbrink

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).