git commit -am是多余的,如果我之前做过git add? [英] Is git commit -am redundant, if I do git add before?

查看:120
本文介绍了git commit -am是多余的,如果我之前做过git add?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行 git add。,然后 git commit -am提交消息?我可以运行 git add。,然后 git commit -mcommit message

/ code>或,可替换地,只 git的承诺-am 提交消息

解决方案

Git add + git commit -m 将会提交您添加的文件(新的和以前跟踪过的),但是 git commit -am 会在被跟踪的文件上提交所有更改,但不会添加新文件。


Is it redundant to run git add . and then git commit -am "commit message"?

Can I just run git add . and then git commit -m "commit message" or, alternatively, just git commit -am "commit message"?

解决方案

Git add + git commit -m will just commit those files you've added (new and previously tracked), but git commit -am will commit all changes on tracked files, but it doesn't add new files.

这篇关于git commit -am是多余的,如果我之前做过git add?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆