Checking the status of a git repository
After a concentrated development and debugging session you are likely to forget all the changes you've made. The >git status
command will remind you.
How to do it...
The git status
command reports the current status of your project. It will tell you what branch you are on, whether you have uncommitted changes and whether you are out of sync with the origin repository:
$ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # #modified: newFeature.tcl
How it works...
The previous recipe shows git status
output when a change has been added and committed and one file was modified but not yet committed.
This line indicates that there has been a commit that hasn't been pushed:
# Your branch is ahead of 'origin...