汇成软件 Create the world!!!

git 合并add commit push 三个命令合为一个

将add、commit、push 三个命令合为一个:

git config --global alias.cmp '!f() { git add -A && git commit -m "$@" && git push; }; f'

使用时只需要 git cmp "内容"
由此可知若想讲add、commit两个命令合为一个只需要输入下面的命令


git config --global alias.cm '!f() { git add -A && git commit -m "$@"; }; f'

使用时只需要 git cm "内容"


---原生写法

git addcommit一起操作 合并操作
千次阅读
2020-02-02 23:27:28

welcome to my blog

执行git commit -am "提交描述"即可将add和commit操作合并, 不需要先git add file 再 git commit -m “提交描述” 了

-a
–all
参数作用: Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.

-m
–message=
参数作用 Use the given as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs.


作者:admin 分类:git 浏览:980 评论:0
留言列表
发表评论
来宾的头像