我正在尝试将以下目录结构提交给 git:
web
/uploads
/avatars
/video
我在 repo 的根目录中.gitkeep放入/web/uploads/avatars/并/web/uploads/video/添加了以下几行:.gitignore
/web/uploads/
!/web/uploads/avatars/.gitkeep
!/web/uploads/video/.gitkeep
但git status不显示任何新文件。调用git add web/uploads/avatars/.gitkeep输出以下消息:
The following paths are ignored by one of your .gitignore files:
web/uploads/avatars/.gitkeep
Use -f if you really want to add them.
fatal: no files added
如何将空目录结构提交到 git 存储库?PS git 版本是 git 版本 1.8.4.msysgit.0