Re: branch ahead in commits but push claims all up to date

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/3/25 Irene Ros <imirene@xxxxxxxxx>:
> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux