Skip to content

Instantly share code, notes, and snippets.

@logicalgroove
Created April 1, 2021 17:37
Show Gist options
  • Save logicalgroove/ae6e0dd6006c890d1eb1055b8771cbc0 to your computer and use it in GitHub Desktop.
Save logicalgroove/ae6e0dd6006c890d1eb1055b8771cbc0 to your computer and use it in GitHub Desktop.
# Git Shortcuts
alias gs='git status'
alias gst='git status -sb'
alias ga='git add'
alias gau='git add -u' # Removes deleted files
alias gp='git pull'
alias gh='git push'
alias gc='git commit -v'
alias gca='git commit -v -a' # Does both add and commit in same command, add -m 'blah' for comment
alias go='git checkout'
alias gl='git log --oneline'
alias gld='git log $(git describe --tags --abbrev=0)..HEAD --oneline --show-notes'
alias gd='git diff --relative --no-prefix'
alias glm='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset" --abbrev-commit --date=relative master..'
alias gfp='git fetch -p'
alias gms='git merge --squash'
alias gri='function __gri() { git rebase -i HEAD~$1; unset -f __gri; }; __gri'
alias grh='function __grh() { git reset --hard origin/$1; unset -f __grh; }; __grh'
alias grhc='grh `git symbolic-ref --short -q HEAD`'
alias gpn='git push origin refs/notes/*'
alias gcp='git cherry-pick'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment