Skip to content

Instantly share code, notes, and snippets.

@jteneycke
Created June 4, 2019 14:39
Show Gist options
  • Save jteneycke/9d7f49d57bcc041b266a84ed3a8bd55f to your computer and use it in GitHub Desktop.
Save jteneycke/9d7f49d57bcc041b266a84ed3a8bd55f to your computer and use it in GitHub Desktop.
Easy git bash aliases
# ~/.bash_profile
# ----------------------
# Git Aliases
# ----------------------
alias g='git'
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add --all'
alias gau='git add --update'
alias gb='git branch'
alias gbd='git branch --delete '
alias gc='git commit'
alias gcm='git commit --message'
alias gcf='git commit --fixup'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gcom='git checkout master'
alias gcos='git checkout staging'
alias gcod='git checkout develop'
alias gd='git diff'
alias gda='git diff HEAD'
alias gi='git init'
alias glg='git log --graph --oneline --decorate --all'
alias gld='git log --pretty=format:"%h %ad %s" --date=short --all'
alias gm='git merge --no-ff'
alias gma='git merge --abort'
alias gmc='git merge --continue'
alias gp='git pull'
alias gpr='git pull --rebase'
alias gr='git rebase'
alias gs='git status'
alias gss='git status --short'
alias gst='git stash'
alias gsta='git stash apply'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash save'
@jteneycke
Copy link
Author

Add these aliases to your ~/.bash_profile, then load those changes into your currently running shell with source ~/.bash_profile so you can use them immediately, or just spawn a new terminal tab to use them from there. 👍

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