我有成千上万个文件需要提交,但是我无法一次性提交所有文件。如何自动每次提交500个文件?前500个文件应该有提交信息“Initial commit part 1”,接下来的500个应该是“Initial commit part 2”,以此类推。我正在使用Windows操作系统。
我有成千上万个文件需要提交,但是我无法一次性提交所有文件。如何自动每次提交500个文件?前500个文件应该有提交信息“Initial commit part 1”,接下来的500个应该是“Initial commit part 2”,以此类推。我正在使用Windows操作系统。
我在git文档中没有看到有关添加特定数量文件的内容。如果可能的话,那就很好了。
你可以将提交分成较小的提交,有几种不同的方式比任意数量更有意义。
您可以提交所有具有某个扩展名的文件:
$ git add *.rb
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: a.rb
new file: b.rb
new file: y.rb
new file: z.rb
你可以按目录提交文件:
$ git add first_dir/
$ git add [a-j]*
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: a.rb
new file: b.rb
Untracked files:
(use "git add <file>..." to include in what will be committed)
y.rb
z.rb
有很多方法可以拆分大的提交 - 我建议根据您的文件逻辑进行最合理的拆分。