Git status Faq:when I issue the "Git status" command, I see the following "Your branch is ahead or origin/master ..." git Message
# on Branch master# Your branch are ahead of ' Origin/master ' by 5 commits. #nothing to commits (working directory clean)
What does this "Your branch are ahead of ' origin/master ' by X commits" message mean? I keep committing my changes with "git commit" and so the message seems to is in error.
Git status Message-your branch is ahead of ' Origin/master ' by X commits
These git 'Your branch is ahead of Origin/master' and ' nothing tocommit' messages can be misleading, ES pecially to new Git users (like myself). The thing to know this your branch isn ' t ahead of the master--your branch is the master.
What's the GIT message is saying are that you ' re ahead of "Origin/master", which (for new projects) is usually the branch on The remote git origin server. (You most likely do a "git clone" to get your Git repository from the origin server.) So this message was telling you ' ve made these changes, and your ' re now ahead of the origin server, and this message is essentially a reminder to push your changes back to the origin server.
If you ' re working in a simple project (like I am) You can push your changes back to the origin server with this command:
Git push Origin Master
Git commit is not "CVS commit" or "svn commit"
Frankly, this was something I ' m really struggling with regarding Git right now. I ' m used to "CVS commit" or "svn commit" committing my changes back to the server, but with Git this is a multi-step step Process, as shown here:
# Make your changes$ git Add. $ git commit-m ' your message ' $ Git push origin master
If you forget so last step--which I always do--you'll see the
"Your branch is ahead of Origin/master by X commits" git status message, along with the "nothing to commit" message (again , reminding a "git push").
Git status Message-your branch is ahead of Origin/master by X commits