你们 git 的命令都 alias 成什么了

2014-05-12 21:39:38 +08:00
 precisi0nux
每天都用很多git命令,输好长一大串,觉得有点浪费时间,想alias成短的,所以想参考下各位V友是怎么做的?谢谢大家啦。
11961 次点击
所在节点    git
37 条回复
582033
2014-05-12 21:41:25 +08:00
104 alias gf='git-ftp'
105 alias gtst='git status'
106 alias gtlg='git log'
107 alias gtlg1='git log --pretty=format:"%h %an %s" --color=auto'
108 alias gtlg2='git log --pretty=oneline'
109 alias gtbr='git branch'
110 alias gtco='git commit'
111 alias gtdi='git diff'
112 alias gv='git svn'
gracece
2014-05-12 21:41:31 +08:00
可以参考Pro git book,常用的就那么几个吧, http://git-scm.com/book/en/Git-Basics-Tips-and-Tricks

要不然就换 on-my-zsh ,补全轻轻松松的。
dorentus
2014-05-12 21:43:50 +08:00
$HOME/.gitconfig

[alias]
lg = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative --show-signature

就这一个,忘了从哪抄来的了。
TankyWoo
2014-05-12 21:56:07 +08:00
.gitconfig:

[alias]
st = status
l = log --pretty=oneline -n 20 --graph --abbrev-commit
ll = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
b = branch
ci = commit
ca = commit -a
pl = pull
ps = push
co = checkout


zsh git:

alias gst="git status"

https://github.com/tankywoo/dotfiles/blob/master/.gitconfig
jkeylu
2014-05-12 22:10:19 +08:00
ChiangDi
2014-05-12 22:33:40 +08:00
huyiwei
2014-05-12 22:35:35 +08:00
顶~你个肺
huyiwei
2014-05-12 22:36:00 +08:00
@582033 对v
xiaolanger1989
2014-05-12 23:13:25 +08:00
没意义,zsh随便补全就好
bitbegin
2014-05-12 23:42:06 +08:00
@jkeylu
kxxoling
2014-05-13 00:08:13 +08:00
source tree
sandtears
2014-05-13 01:03:33 +08:00
我都是用 zsh 的补全
lightening
2014-05-13 05:06:15 +08:00
@ChiangDi 我也用这一套 alias。
补全还要按一下 tab,慢死了……
liul85
2014-05-13 07:11:31 +08:00
用的iterm的git插件
gp = git push
gco = git check out
gl = git pull
......
liul85
2014-05-13 07:12:30 +08:00
写错了,是oh-my-zsh的git插件
timothyye
2014-05-13 07:32:01 +08:00
git push gps
git pull gpl
git status gs
git commit gc
cielpy
2014-05-13 09:22:52 +08:00
@sandtears
@xiaolanger1989 自动补全是指按tab,然后给选项那种?
ChiangDi
2014-05-13 09:35:18 +08:00
@lightening 哈哈我也觉得,所以应该告诉楼上的用自动补全的同学们,按tab键很蛋疼的,赶快用6楼的!
cielpy
2014-05-13 09:39:28 +08:00
@ChiangDi ohmyzsh不用按tab吗。。怎么设置。。我设置了好像不管用。
precisi0nux
2014-05-13 09:41:31 +08:00
@ChiangDi 我一直在用oh-my-zsh,没想到官方有推荐的alias,真是out了,试用了一下感觉非常不错,谢谢啦。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/112237

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX