如何分别提交文件夹和文件(在文件夹中)?

How to commit the folderA and fileB (in folderA) separately?

我有一个包含一些文件的文件夹,如果我在这个文件夹中添加一个额外的文件,现在我想提交,是否可以单独提交它们?像 :

  1. 提交到此文件夹:“添加新文件”
  2. 提交附加文件:“新算法”

你应该简单地:

  1. 仅添加您要提交的文件git add myfile.ext
  2. 提交更改 git commit -m "Add a new file"
  3. 添加休息git add *
  4. 提交新更改git commit -m "new algorithm"