Skip to content

Instantly share code, notes, and snippets.

Last active Feb 5, 2021
What would you like to do?
使用 alias 提高 git 使用效率
alias gcl='git clone'
alias gs='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gl='git lg'
alias gps='git push -u'
alias gconf='vi .git/config'
alias gamend='git commit --amend'
alias gamendy='git commit --amend --no-edit'
alias gback='git reset --hard HEAD~'
alias gpl='git pull && git submodule update --init'
alias gplr='git pull --rebase'
alias gplp='git pull --prune'
alias gplpr='git pull --prune --rebase'
alias gss='git show --name-status'
alias gdiff='git diff --no-index'
alias gdl='git diff HEAD~'
alias gdn='git diff --name-only'
alias ga='git add -A'
alias gm='git commit -m'
alias gma='git commit -am'
alias gmerge='git merge --no-ff'
alias gb='git branch'
alias gbc='git branch --contains'
alias gc='git checkout'
alias gra='git remote add'
alias grr='git remote rm'
alias grv='git remote -v'
alias grl='git remote get-url (git remote)'
alias grlc='grl | pbcopy'
alias gtam='git tag -a -m'
alias gtags='git tag -n99 --sort v:refname -l'
alias gf='git reflog'
alias gcp='git cherry-pick'
alias gcpf='git cherry-pick --strategy-option theirs'
alias grb='git rebase'
alias grbc='git rebase --continue'
alias grba='git rebase --abort'
alias gclean='git clean -id'
alias greset='git reset --hard'
alias git-head-hash='git log --pretty=format:"%h" --abbrev=7 -n 1'
alias git-tags-with-timestamp='git log --tags --simplify-by-decoration --pretty="format:%ci %d" | grep tag | sed "s/[(),]//g" | sed "s/tag: //g" | less'
alias gamend-with-author-weaming='git commit --no-edit --amend --author "weaming <>"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment