Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"branch is up-to-date with origin" but actually not

Tags:

git

Is the message a bit mis-leading?

When checkout a branch (eg., b535), git does it and says "Your branch is up-to-date with 'origin/b535'." That sounds like what I have in my local branch b535 is up-to-date.

$ git checkout b535
Previous HEAD position was 8aa0145... master - resyns
Switched to branch 'b535'
Your branch is up-to-date with 'origin/b535'.

But actually it's not. When doing a git pull, it found updates from remote and updating local branch.

$ git pull origin b535
remote: Counting objects: 39, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 39 (delta 31), reused 0 (delta 0)
Unpacking objects: 100% (39/39), done.
...
like image 431
artm Avatar asked Feb 03 '16 20:02

artm


1 Answers

Well, your branch is up to date with the last known position of origin/b535. If you want git status to give you more accurate info without having to do a git pull, do a git fetch instead. This will update origin/b535, without changing your local b535.

like image 107
David Deutsch Avatar answered Oct 14 '22 23:10

David Deutsch