如何在git中提交许多文件

Lab*_*ino 2 git

我知道如何添加和提交一个文件:

git add [file name]git commit -m

但是如果我在不同的目录中有很多文件呢?怎么做正确的方法呢?谢谢.

小智 7

首先将所有文件添加到舞台,例如:

git add file1 file2 file3 file4
Run Code Online (Sandbox Code Playgroud)

或整个目录:

git add directory1/ directory2/
Run Code Online (Sandbox Code Playgroud)

当所有人都上演时,您可以立即全部提交:

git commit -m "All at once"
Run Code Online (Sandbox Code Playgroud)