Subject: Re: [OT] Your branch is ahead of the tracked remote branch 'origin/master' by 50 commits.

From: SZEDER Gábor <[email-masked]>
Date: Tue, 1 Jul 2008 13:41:49 +0200

Hi Ingo,

On Tue, Jul 01, 2008 at 12:14:15PM +0200, Ingo Molnar wrote:
> i have a tip-curr (shortcut: 'tc') scriptlet to answer the "where I am 
> amongst 100+ branches" question:
> 
>   earth4:~/tip> tc
>   tip/master 200a86b: Merge branch 'x86/unify-setup'
> 
> which is just a thin wrapper around git-log:
> 
>   earth4:~/tip> cat ~/bin/tip/tip-curr
>   #!/bin/bash
> 
>   . ~/bin/tip/tip-lib
> 
>   echo "tip/"$(get_current_branch)" "$(git log -1 --pretty=format:"%h: %s")
how about displaying the current branch in the command prompt?

>>From contrib/completion/git-completion.bash:

  #    4) Consider changing your PS1 to also show the current branch:
  #        PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
  #
  #       The argument to __git_ps1 will be displayed only if you
  #       are currently in a git repository.  The %s token will be
  #       the name of the current branch.

Regards,
Gábor