I'm using the "Github For Windows" shell and was trying to commit something and came across what looks like an error:
C:\Path\Name\ [master +2 ~1 -0 !]>
What does +2 ~1 -0 !
mean?
NOTE: I fixed the error by modifing every file in the directory and re commiting and pushing, now it's just [master]
, but I still don't understand the numbers.
In Git, "master" is a naming convention for a branch. After cloning (downloading) a project from a remote server, the resulting local repository has a single local branch: the so-called "master" branch. This means that "master" can be seen as a repository's "default" branch.
-M is a flag (shortcut) for --move --force per the docs page on git branch . It renames the branch main (since the default branch name for repositories created using the command line is master , while those created in GitHub [starting in Oct.
You are seeing master because you created a git repository at the current path using the git init command. Always create git repositories in the folders containing project files. Consider running rm -rf . git command.
What is git rebase? Rebasing is the process of moving or combining a sequence of commits to a new base commit. Rebasing is most useful and easily visualized in the context of a feature branching workflow.
This is not an error, just some helpful information.
I suppose you are using Github For Windows
- it uses posh-git by default, and the prompt is explained in the README of posh-git
itself:
+ = Added files
~ = Modified files
- = Removed files
! = Conflicted files
Go through the README and you can see how it relates to the git status
output.
That prompt probably meant:
In your current git branch - master
, you had added two files +2
, modified one ~1
and removed zero -0
. Check this comment for more info.!
signifies you are currently at the root of the repository.
Not sure which shell you are using - But you may want to check the PROMPT
and PS1
environment variables to find what those items mean in your prompt.
The prompt got reset to just [master]
- once you had committed all the changes, as you mentioned in your questions.
PROMPT
environment variable is the one used by the windows shell cmd
, and PS1
is used by unixy shells - like bash.
Edit: Totally missed the powershell
tag you put in there - I'm not a windows guy - but looks like in powershell you create a prompt
function - check this link: http://www.johndcook.com/blog/2008/05/12/customizing-the-powershell-command-prompt/
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