threads / discuss / 19416

Re: problems getting uptodate from a remote repository

Subject: Re: problems getting uptodate from a remote repository

## tl;dr

3 messages between May 19, 2009 and May 19, 2009.

replies: 2people: 3as markdown or json

Aaron Gray· May 19, 2009, 16:09 UTC · lore
I have done a 'git fetch' but the repo is not being updated to latest changes.
I am getting the message :-
    "Your branch is behind 'origin/master' by 53 commits, and can be
fast-forwarded.
when I do a 'git checkout master'
What is going on here and what can I do about it ?
Here's my config :-

$ git config -l core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true core.ignorecase=true remote.origin.url=git://git.cybercomms.org/llvm/trunk/.git remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* branch.master.remote=origin branch.master.merge=refs/heads/master

Many thanks in advance,
Aaron
Robert Haines· May 19, 2009, 17:03 UTC · re: Aaron Gray · lore
Hi Aaron,
On 19 May 2009, at 17:09, Aaron Gray wrote:
Show 11 quoted lines
> I have done a 'git fetch' but the repo is not being updated to  
> latest changes.
>
> I am getting the message :-
>
>    "Your branch is behind 'origin/master' by 53 commits, and can be
> fast-forwarded.
>
> when I do a 'git checkout master'
>
> What is going on here and what can I do about it ?
<snip config>

A fetch just updates your remote tracking branches in your local repository, it doesn't merge them as well. To update your local master you would then do (while on branch master):

$ git merge origin/master

This extra step allows you to create a new branch with origin/master as its start point to check that you're happy with the updates before you update your local master should you wish to do so.

Cheers, Rob

Sverre Rabbelier· May 19, 2009, 17:19 UTC · re: Aaron Gray · lore
Heya,

On Tue, May 19, 2009 at 18:09, Aaron Gray <aaronngray.lists@googlemail.com> wrote:

> I have done a 'git fetch' but the repo is not being updated to latest changes.

Fetch only 'fetches' the data, it doesn't update your working copy. To get your working copy up to date you can do 'git merge origin' after you do 'git fetch origin'. That is such a common operation that there is a single command that does just that, 'git pull origin' will do what you want :).

-- 
Cheers,

Sverre Rabbelier

← back to recent threads