Just a quick note of how I set up git-completion and git-prompt in tcsh when using a homebrew build of git.
TCSH
git-completion for tcsh piggyback on the bash implementation and it needs a little bootstrapping:
ln -s "`brew --prefix git`/share/git-core/contrib/completion/git-completion.tcsh" ~/.git-completion.tcsh ln -s "`brew --prefix`/etc/bash_completion.d/git-completion.bash" ~/.git-completion.bashBecause a tcsh equivalent of
git-prompt.sh does not exist, I settle for just adding the current git branch to my prompt:
#.tcshrc
#git completion
source ~/.git-completion.tcsh
# set prompt; with current git branch if available.
alias __git_current_branch 'git rev-parse --abbrev-ref HEAD >& /dev/null && echo "{`git rev-parse --abbrev-ref HEAD`}"'
alias precmd 'set prompt="%n@%m[%c2]`__git_current_branch` "'
Bash
After 'brew install bash-completion' and 'brew install git',
git-completion is immediately available. For git-prompt just source git-prompt.sh in .bashrc:
#.bashrc
# source git-prompt
. "$(brew --prefix git)/etc/bash_completion.d/git-prompt.sh"
# set prompt; with current git branch if available.
PS1='\u@\h[\W]$(__git_ps1 "{%s}") '