Thanks, this is great. I think I prefer the prompt that Jed gave me: PS1="\A$bold$magenta\$(ret=\$?; [ \$ret -ne 0 ] && echo -n \" \$ret\")$nbold $blue\$(__git_ps1 '%s') $green\w$normal\\$ "
But the GIT_PS1_SHOW... stuff just adds a char to the branch name that is pretty nice. On Mon, Jun 1, 2015 at 1:46 PM, Satish Balay <ba...@mcs.anl.gov> wrote: > On Mon, 1 Jun 2015, Mark Adams wrote: > > > > > > > > > > Also 'git-prompt.sh' helps in tracking changes to any giving 'branch' > > > wrt 'origin/branch'.. [assuming you do a 'git fetch' to sync changes > > > from remote repo] > > > > > > > > I use (a) git-prompt.sh. It shows the branch in the prompt. How does it > > help? Does it do the .. stuff? > > I use: > > export GIT_PS1_SHOWDIRTYSTATE=1 > export GIT_PS1_SHOWUPSTREAM="auto" > export PS1='\[\e[32m\]\u@\h > \[\e[36m\]${PWD}\[\e[1m\]\[\e[35m\]$(__git_ps1 " (%s)")\[\e[0m\]\n\$ ' > > And I see something like the following in addition to the branch name. > > balay@asterix /home/balay/petsc (master=) > > Here - the status flag currently is '='. The usual values are: > '=' => both branches origin/master, master are in sync > '<' => there are new remote changes that I should pull > '>' => there are localchages that I should push. > > And there are other status flags that get displayed based on local > edits, stuff added to index etc.. > > For eg: > > balay@asterix /home/balay/petsc (master=) > $ echo 'x' >> makefile > balay@asterix /home/balay/petsc (master *=) > $ git add makefile > balay@asterix /home/balay/petsc (master +=) > $ git commit -m 'test commit' > [master 7672695] test commit > 1 file changed, 1 insertion(+) > balay@asterix /home/balay/petsc (master>) > $ git reset --hard origin/master > HEAD is now at e06cc25 Custom Fortran stub pcfieldsplitgetsubksp_() did > not free array containing the KSPs > balay@asterix /home/balay/petsc (master=) > $ > > So one can potentially keep track of how the changes on the branch are > evolving - and not be *suprised* by the final state you are at. [which > can be checked with 'git log origin/master..master' command]. > > One can always reset the branch - pickup relavent stuff from abandoned > branches etc. > > Satish > >