简体   繁体   中英

What does the prompt “[master +1 ~0 -0 !]>” mean when using Git command line?

After a few Git commands, I find my command line prompt change from

[master]>

to

[master +1 ~0 -0 !]>

What does this mean?

This represents the number of files:

  • added ( + )
  • modified ( ~ )
  • deleted ( - )
  • conflict ( ! ) (from alisa 's answer )

You can see a powershell version of that prompt here .

powershell提示

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:

  • Conflicts ( ! )

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.

Since you do have a conflict (!). Type: git status -to find out which folder has the conflict.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM