Git命令简写

1.简写对应表

简写 完整命令
g git
gst git status
gd git diff
gdc git diff --cached
gdv git diff -w "$@" | view -
gl git pull
gup git pull --rebase
gp git push
gc git commit -v
gc! git comit -v --amend
gca git commit -v -a
gca! git commit -v -a --amend
gcmsg git commit -m
gco git checkout
gcm git checkout master
gr git remote
grv git remote -v
grmv git remote rename
grrm git remote remove
grset git remote set-url
grup git remote update
grbi git rebase -i
grbc git rebase --continue
brba git rebase --abort
gb git branch
gba git branch -a
gcount git shortlog -sn
gcl git config --list
gcp git cherry-pick
glg git log --stat --max-count=10
glgg git log --graph --max-count=10
glgga git log --graph --decorate --all
glo git log --oneline --decorate --color
glog git log --oneline --decorate --color --graph
gss git status -s
ga git add
gm git merge
grh git reset HEAD
grhh git reset HEAD --hard
gclean git reset --hard && git clean -dfx
gwc git whatchanged -p --abbrev-commit --pretty=medium
gpoat git push origin --all && git push origin --tags
gmt git mergetool --no-prompt
gg git gui citool
gga git gui citool --amend
gk gitk --all --branches
gsts git stash show --text
gsta git stash
gstp git stash pop
gstd git stash drop
grt cd $(git rev-parse --show-toplevel || echo || echo ".")
git-svn-dcommit-push git svn dcommit && git push github master:svntrunk
gsr git svn rebase
gsd git svn dcommit

编辑.gitconfig文件,可以copy下边的直接替换,根据喜好可以增减和修改

# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
#       name = hanya
#       email = hanya@MacBook-Pro
 
[merge]
    summary = true
    tool = vimdiff
[diff]
    renames = copy
[color]
    diff = auto
    status = true
    branch = auto
    interactive = auto
    ui = auto
    log = true
[status]
    submodulesummary = -1
[mergetool "vimdiff"]
    cmd = "vim --noplugin \"$PWD/$MERGED\" \
          +\":split $PWD/$REMOTE\" +\":set buftype=nowrite\" \
          +\":vertical diffsplit $PWD/$LOCAL\" +\":set buftype=nowrite\" \
          +\":vertical diffsplit $PWD/$BASE\" +\":set buftype=nowrite\" \
          +\":wincmd l\""
[format]
    numbered = auto
[alias]
    co = checkout
    ci = commit
    st = status
    pl = pull
    ps = push
    dt = difftool
    l = log --stat
    cp = cherry-pick
    ca = commit -a
    b = branch
    pso = push origin
    plo = pull origin
    cm = commit -m
    gst = git status
    gd = git diff
    gl = git pull
    gp = git push
    glo = git pull origin
    gpo = git push origin
    gcm = git common -m
    gc = git checkout
    gcm = git checkout master
    gcd = git checkout develop
    gb = git branch
    ga = git add .
[user]
        name = hanya
        email = hanya-mac@xiaomi.com
[core]
        excludesfile = /Users/hanya/.gitignore_global
[difftool "sourcetree"]
        cmd = opendiff \"$LOCAL\" \"$REMOTE\"
        path =
[mergetool "sourcetree"]
        cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
        trustExitCode = true

推荐阅读更多精彩内容

  • pdf下载地址:Java面试宝典 第一章内容介绍 20 第二章JavaSE基础 21 一、Java面向对象 21 ...
    王震阳阅读 78,704评论 25 511
  • Ubuntu的发音 Ubuntu,源于非洲祖鲁人和科萨人的语言,发作 oo-boon-too 的音。了解发音是有意...
    萤火虫de梦阅读 53,035评论 12 414
  • linux资料总章2.1 1.0写的不好抱歉 但是2.0已经改了很多 但是错误还是无法避免 以后资料会慢慢更新 大...
    O感悟人生O阅读 7,435评论 2 27
  • 序 如果……一切都还来得及的话,就不会发生那样的事了。 可又有谁能料想到呢? 谁也改变不了命运,也只有命运去引领自...
    董香酱是我的阅读 17评论 0 0
  • 圣诞节前一周,我收到孩子幼儿园老师发来的信息,要求准备一份礼物并悄悄带到幼儿园,圣诞节那天,由“圣诞老人”亲自发给...
    尚小迪阅读 166评论 0 4