8

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

[master]>

to

[master +1 ~0 -0 !]>

What does this mean?

Levent Divilioglu
  • 11,198
  • 5
  • 59
  • 106
Wayne Wang
  • 1,287
  • 12
  • 21
  • Is this using git-bash on Windows? Or something else? If “something else” then it completely depends on how your prompt is setup. – Andrew Marshall Aug 17 '13 at 19:37
  • @AndrewMarshall looks like a [Posh Git](https://github.com/dahlbyk/posh-git) setup. GitHub for Windows distributes it with their app too. –  Aug 17 '13 at 21:05
  • Exactly, I am using Posh Git, which is included when I install GitHub windows. Very useful hits to know the current status of my repository. – Wayne Wang Aug 18 '13 at 02:40
  • 1
    @WayneWang those prompts are nice but `git status` is more descriptive and even shows some helpful advices to solve some situations, if you have any doubt on the state of the repo I would recommend you to use `git status`. I also use that kind of prompts (gitprompt on bash and an embed one on fish) but I never stopped to use `git status` to really understand the state of the repo. – Fernando Jan 14 '15 at 06:38

3 Answers3

12

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 prompt

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.

commit ahead

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
4

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.

Alisa
  • 2,892
  • 3
  • 31
  • 44
0

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

timmyt123
  • 401
  • 5
  • 8