Updating branches with git pull

git version 1.7.3.5 

I have the following branches:

 git branch image master * video 

I worked in an office. And when I got home, I constantly update my home laptop.

However, when I did git remote show origin , I got the following:

  Local refs configured for 'git push': image pushes to image (up to date) master pushes to master (fast-forwardable) video pushes to video (local out of date) 

So, I did git pull for all of these branches:

 git pull origin image git pull origin master git pull origin video 

When I execute git status on the video and image branch, I get:

  nothing to commit (working directory clean) 

When I execute git status on the main branch, I get:

 Your branch is ahead of 'origin/master' by 5 commits. 

I do not understand the following (fast-forwardable) and (local out of date) ?

But in git state for the video did he say that it is updated?

Do I need to push my master, if he is ahead, 5 commits?

Thanks so much for any suggestions.

+8
git
source share
1 answer

git remote show origin compares your local repository with the remote control:

  • fast-forwardable means that you can redirect local changes to a remote branch.
  • local out of date means that your local branch is behind the remote branch, and you have to pull it out.

git status compares your local working directory with the current commit of the current branch (aka HEAD ). In addition, it compares your local branch with a (local!) Copy of tracking the remote branch ( origin/master ), so Your branch is ahead of 'origin/master' by 5 commits.

To resolve the discrepancy between git status (which shows only local data) and git remote show origin (which shows "direct" remote data), you must run git remote update origin , which will update your local tracking branches. It will update your local origin/master to the state of the remote master . After that, git status should give you something like Your branch is behind 'origin/master' by X commits, and can be fast-forwarded.

+14
source share

All Articles