Skip to content

Instantly share code, notes, and snippets.

@emmahsax
Last active August 13, 2023 22:10
Show Gist options
  • Save emmahsax/e8744fe253fba1f00a621c01a2bf68f5 to your computer and use it in GitHub Desktop.
Save emmahsax/e8744fe253fba1f00a621c01a2bf68f5 to your computer and use it in GitHub Desktop.
Personal git aliases

Personal Git Aliases

A list of git aliases I use on my machines to make working with GitHub and GitLab a little bit faster.

For more information, see my Ruby command-line gem: emmahsax/git_helper.

alias gadd='git add -A'
alias gaddp='git add -p'
alias gcam='git commit -am'
alias gcav='git commit -av'
alias gcavp='git commit -av && git push'
alias gcempty='git empty-commit'
alias gcg='git clean-branches'
alias gch='git checkout'
alias gchd='git checkout-default'
alias gchp='git checkout -'
alias gcp='git cherry-pick'
alias gcr='git code-request'
alias gcv='git commit -v'
alias gcvp='git commit -v && git push'
alias gdiff='git diff'
alias gflc='git forget-local-commits'
alias gflch='git forget-local-changes'
alias gmcr='git merge-code-request'
alias gnb='git new-branch'
alias gpull='git pull'
alias gpush='git push'
alias grem='git change-remote'
alias grvh='git rev-parse HEAD'
alias gstash='git stash'
alias gstat='git status'

function grebase {
  git rebase -i HEAD~$1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment