Skip to content

Instantly share code, notes, and snippets.

@NikitaShkaruba
Last active April 7, 2020 12:56
Show Gist options
  • Save NikitaShkaruba/06afbdb14a42a11c4a3a864f8f7c8615 to your computer and use it in GitHub Desktop.
Save NikitaShkaruba/06afbdb14a42a11c4a3a864f8f7c8615 to your computer and use it in GitHub Desktop.
### GIT ###
# Frequently used
git config --global alias.co checkout
git config --global alias.st status
git config --global alias.re reset
# Not frequently used
git config --global alias.ci commit
git config --global alias.br branch
# Push / pull strategies
git config --global push.default current
git config --global pull.default current
# Bash prompt with git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
### TERMINAL ###
alias git_recent_checkouts='git reflog --date=relative | head -n 100 | grep checkout'
# Configs
set -o vi
# Bash line
export PS1="\u@\033[32m\]\h\[\033[m\] \W\[\033[35m\]\$(parse_git_branch)\[\033[00m\] $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment