git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Tapsell <johnflux@gmail.com>
To: Irene Ros <imirene@gmail.com>
Cc: Daniel Barkalow <barkalow@iabervon.org>, git@vger.kernel.org
Subject: Re: branch ahead in commits but push claims all up to date
Date: Thu, 26 Mar 2009 02:05:21 +0000	[thread overview]
Message-ID: <43d8ce650903251905p6f9798f5u79be7dff3b118d5c@mail.gmail.com> (raw)
In-Reply-To: <7001b7a00903251023r1ce5cc0dnb29b7f9379408c42@mail.gmail.com>

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

  parent reply	other threads:[~2009-03-26  2:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2009-03-26 12:48                   ` Björn Steinbrink

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43d8ce650903251905p6f9798f5u79be7dff3b118d5c@mail.gmail.com \
    --to=johnflux@gmail.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=imirene@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.
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).