After a few Git commands, I find my command line prompt change from
[master]>
to
[master +1 ~0 -0 !]>
What does this mean?
At its core, Git is a set of command line utility programs that are designed to execute on a Unix style command-line environment. Modern operating systems like Linux and macOS both include built-in Unix command line terminals. This makes Linux and macOS complementary operating systems when working with Git.
The 'git master' just means that it thinks that the directory you're in right now is a Git repository, with new, unstaged changes. All of this has to do with source control.
For Windows, when installing Git through the installer, it is recommended you select the “Use Git from the Windows Command Prompt” option. This will allow you to use all git commands through your terminal (CMD, PowerShell, Anaconda) rather than having to use Git's personal terminal, Git Bash.
The git status command displays the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git.
This represents the number of files:
+
)~
)-
)!
) (from alisa's answer)You can see a powershell version of that prompt here.
Those represent the status before commit (added means added to the index, or 'staged')
Here is a more complete version of that prompt, which also display the number of commits ahead or behind an upstream repository.
When you do some changes and commit them, your state is 1 commit ahead of remote. It is very useful to know how many commits you have unpushed.
And:
Usually there is no conflict, but sometimes it occurs (for example when a file is changed in both your local repository and the online repository, and you want to pull. So Git doesn't know which one to keep).
In these cases, you have to correct and save the conflicting file (that is already marked by Github, showing the conflicting lines) manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With