Skip to content

Instantly share code, notes, and snippets.

@lerox
Last active January 15, 2019 12:17
Show Gist options
  • Save lerox/762356e26aec3a2b40b2 to your computer and use it in GitHub Desktop.
Save lerox/762356e26aec3a2b40b2 to your computer and use it in GitHub Desktop.
Custom bashrc to use git-prompt and git-completion on command-line interface (cli)
# ~/.custombashrc
# Put this file to be included by ~/.bashrc
# https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
source ~/.git-completion.sh
# https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
source ~/.git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
# GIT_PS1_SHOWUPSTREAM="auto"
GIT_PS1_SHOWCOLORHINTS=true
# GIT_PS1_SHOWUNTRACKEDFILES=true
# GIT_PS1_SHOWSTASHSTATE=true
PROMPT_COMMAND="__git_ps1 '\u@\h:\w' '\\$ ' ' [%s]' "
# pbcopy
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
# docker aliases
alias dc=docker-compose
# weather
alias tempo="curl -4 http://wttr.in?Sao_Paulo"
alias weather=tempo
@lerox
Copy link
Author

lerox commented Sep 26, 2014

Unstaged (*) and staged (+) changes will also be shown next to the branch name.

@lerox
Copy link
Author

lerox commented Jan 14, 2015

Example: vagrant@precise32:/vagrant/project [branch_name *]$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment