You can double-check this by running the git branch command. This tells you what branch name is currently checked out in the working directory. The first piece of data git status tells you is what branch you're on, such as On branch master or On branch dev or On branch featureBranch1. Git status is your best friend when you ask yourself any of the following questions. Note that the current Git branch (1) and branch syncing status (2) will show up any time you execute git status.Īlso note that Changes to be committed (3), Changes not staged for commit (4), and Untracked files (5), will only be displayed if a file exists and meets the conditions for that section. " to include in what will be committed)Īs you can see, we added the numbers (1) - (5) to the output corresponding to the bullet points in the previous section. " to discard changes in working directory) (2) Your branch is up to date with 'origin/master'. Running the command git status provides the following output by default: (1) On branch master So make sure you use cd to navigate into your development project before running git commands. If you run git status outside of any Git repository, you'll probably get the following fatal Git error: > git statusįatal: not a git repository (or any of the parent directories). What is the output of the Git status command? Finally we'll go over some lesser-known command-line options for git status usage and mention some related Git commands. We'll also cover when to use git status, and provide some git status examples. In this article, we'll discuss each of these points in-depth so you understand how to use this information.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |