From: Irene Ros <imirene@gmail.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: John Tapsell <johnflux@gmail.com>, git@vger.kernel.org
Subject: Re: branch ahead in commits but push claims all up to date
Date: Wed, 25 Mar 2009 13:23:43 -0400 [thread overview]
Message-ID: <7001b7a00903251023r1ce5cc0dnb29b7f9379408c42@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.1.00.0903242304530.19665@iabervon.org>
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*
>
next prev parent reply other threads:[~2009-03-25 17:25 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 [this message]
2009-03-25 17:32 ` Santi Béjar
2009-03-26 2:05 ` John Tapsell
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=7001b7a00903251023r1ce5cc0dnb29b7f9379408c42@mail.gmail.com \
--to=imirene@gmail.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=johnflux@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).