News for hackers. Stuff that matters.
Re:Mercurial developer responds to "Switch to git?" by hrjet on Sunday November 17, 2013 @11:05PM (#6752452)
What is "git prompt" and how do I turn it on? A quick search didn't reveal anything.
Re:Mercurial developer responds to "Switch to git?" by matwood on Monday November 18, 2013 @10:26AM (#6754708)
Add this to wherever you setup your bash prompt:

source /usr/local/git/contrib/completion/git-prompt.sh

source /usr/local/git/contrib/completion/git-completion.bash

GIT_PS1_SHOWDIRTYSTATE=true

export PS1='\u@\h \[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 "\[\033[01;33m\](%s)\[\033[00m\]")$ '

source ~/.profile

What this does is add a git style prompt anytime you are in a directory managed by git. On the prompt it will show your current branch, what state it is in (+'s/*'s show if you have changes), if your are merging/rebasing/cherry-picking/etc...

The source files may live in slightly different places on your machine depending on where you installed git.

This above also adds tab completion for git commands, branches, tags, etc...

Also, see my .gitconfig for aliases I have put together from various places on the net:

https://github.com/matwood/cfg/blob/master/.gitconfig

Re:Mercurial developer responds to "Switch to git?" by riannucci on Sunday November 17, 2013 @11:37PM (#6752563)
I think the parent is meaning something like the git-status integration of e.g. oh-my-zsh [0], or something like the 'official' git-status integration script for bash [1]

(I've used the former, but not the latter.)

[0] https://github.com/robbyrussell/oh-my-zsh [1] https://raw.github.com/git/git/master/contrib/completion/git...