简体   繁体   中英

How to add *all* new/modified files to git, from anywhere? (like `git add -A`, or `git commit -a` for new files)

Is there an equivalent of git commit -a for staging new files?

This is the behavior of git add -A , but only if you call it from the root directory of your repository. Otherwise, it will only add files in the subdirectory.

Or does there not exist such built-in functionality, making the easiest program to write something like git add -A $(git rev-parse --show-toplevel) ?

您可以使用git的内置别名 ,其中包括调用shell脚本的功能。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM