Skip to content

Instantly share code, notes, and snippets.

@james-jlo-long
Last active December 15, 2020 10:25
Show Gist options
  • Save james-jlo-long/0b2c3b854048b7bef66da17791fdf5a7 to your computer and use it in GitHub Desktop.
Save james-jlo-long/0b2c3b854048b7bef66da17791fdf5a7 to your computer and use it in GitHub Desktop.
The abbreviations that I use for git. Place this file in "~" and be sure to grab the ".git-completion.bash" file
# Git bash completion
# https://gist.github.com/JuggoPop/10706934
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
__git_complete gch _git_checkout
__git_complete gf _git_fetch
__git_complete gp _git_push
__git_complete gm _git_merge
__git_complete gr _git_rebase
fi
# Git aliases
alias gm='git merge'
alias gc='git commit'
alias gca='git commit -a'
alias gcam='git commit -am'
alias gaca='git add . ; git commit -a'
alias gacam='git add . ; git commit -am'
alias glog="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gf='git fetch'
alias gfs='printf "Fetching:\n"; git fetch; printf "\n\nStatus:\n"; git status'
alias gst='git status'
alias gr='git rebase'
alias gp='git push'
alias gd='git diff'
alias gdn='git diff-tree --no-commit-id --name-only -r'
alias gsn='git show --no-patch'
alias gch='git checkout'
# Utility alias
alias ll='ls -alh --color=auto'
alias grepp='grep -rin --color'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment