GIT,如何确认提交删除的大量文件?

GIT,如何确认提交删除的大量文件?

发行后

git commit

我看到 vi 打开了类似这样的内容

# Changes to be committed:
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/Contents.json
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/icon1024.png
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/icon_IPAD20.png
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/[email protected]
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/icon_IPAD29.png
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/[email protected]
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/icon_IPAD40.png
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/[email protected]
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/icon_IPAD76.png
#       deleted:    MyApp (original)/Assets.xcassets/AppIcon.appiconset/[email protected]

我应该删除每行开头的#。

问题是这个列表包含 2000 行(是的,我想删除所有内容)。

有没有更合理的方法来确认每个条目?

答案1

您不必删除#每个开头的 。该文件的内容是示例提交消息。任何前面带有 的内容#都是注释。git 会将任何非注释内容作为提交消息。

我建议-m在 git commit 后使用该标志。例如git commit -m 'deleted a bunch of files'

这样,您就不必每次都编辑文件,只需在命令行中输入提交消息即可。

相关内容