git-prompt
New prompt string for Windows cmd.exe based on Git branch name.
- Quiet · last change 10-1-2014
- ★ 1 on GitHub
README
##README
git-prompt.exe will generate a git-prompt.bat in your specified folder. After that, you can use git-prompt.bat to change DOS-box prompt whick embeded your .git branch name.
###Setup
- Copy git-prompt.exe into <Git install folder>\libexec\git-core. We can use "git prompt" to execute this command from now on. You need to delete git-prompt.bat and git-prompt.ini first.
- At firsttime run git prompt, git-prompt.ini will created in git-core folder. Modify it to change the PromptBatch, then excute git prompt again to generate git-prompt.bat to your specified folder.
- From now on, use git-prompt.bat to change the prompt based on your brance name.
###Usage
rem 1. Generate git-prompt.bat
git prompt
rem 2. Change the prompt
git-prompt
rem Run in the same time
git prompt > chg.bat && chg.bat
rem Display the sort description
git prompt -?###git-prompt.ini sample:
[Prompt]
DefaultFG=light green
DefaultBG=black
HighlightFG=light green
HighlightBG=black
HighlightFG.up-to-date=light cyan
HighlightBG.up-to-date=black
HighlightFG.behind=light red
HighlightBG.behind=black
HighlightFG.nonsync=light yellow
HighlightBG.nonsync=black
HighlightFG.ahead=light green
HighlightBG.ahead=black
PromptBatch=d:\util\git-prompt.bat###Version info
- v0.01 2014/09/02 Initial version
- v0.02 2014/09/03: Add different color for branch status
- v0.03 2014/09/04: Get root folder to read HEAD file properly

