如何使用单个命令来分阶段和提交所有文件,包括新添加的文件? [英] How can I stage and commit all files, including newly added files, using a single command?

查看:82
本文介绍了如何使用单个命令来分阶段和提交所有文件,包括新添加的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用单个命令来分阶段和提交所有文件,包括新添加的文件?

  git add -A&& git commit -mYour Message

算作单一命令?






说明(来自 git add 文档):


-A,--all,--no-ignore-removal



不仅在工作树有文件匹配,而且索引已经有
条目。 添加,修改和删除索引条目以匹配
工作树。



如果-A选项为使用时,更新
整个工作树中的所有文件(Git的旧版本用于将
更新限制为当前目录及其子目录)。



How can I stage and commit all files, including newly added files, using a single command?

解决方案

Does

git add -A && git commit -m "Your Message"

count as a "single command"?


Explanation (from git add documentation):

-A, --all, --no-ignore-removal

Update the index not only where the working tree has a file matching but also where the index already has an entry. This adds, modifies, and removes index entries to match the working tree.

If no is given when -A option is used, all files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).

这篇关于如何使用单个命令来分阶段和提交所有文件,包括新添加的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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