Git---Git别名(来点花样)

来源:互联网 发布:怎么设置网络速度限制 编辑:程序博客网 时间:2024/04/28 07:05

概述:

将长长的名字变成个性化名称,将一个命令字符串赋值给一个变量。

1.为提交取一个别名  

语法: git config --global alias.ci commit

$ vim READMEAdministrator@USER-20170424ZG MINGW64 ~/grit (master)$ git statusOn branch masterYour branch is ahead of 'origin/master' by 13 commits.  (use "git push" to publish your local commits)Changes not staged for commit:  (use "git add <file>..." to update what will be committed)  (use "git checkout -- <file>..." to discard changes in working directory)        modified:   READMEUntracked files:  (use "git add <file>..." to include in what will be committed)        ticgit/no changes added to commit (use "git add" and/or "git commit -a")Administrator@USER-20170424ZG MINGW64 ~/grit (master)$ git ci -a -m "README"[master ac67cd6] README 1 file changed, 1 insertion(+), 1 deletion(-)
总结:git ci -a -m "README"

总结:本质理解别名就是字符串替代,但不能是git关键字