如何解决此问题并使其停止发生
CONFLICT(删除/修改):在eccc398bb3058c5c0cc9e3587aae93289597fc0f中删除了log / development.log,并在HEAD中修改。 log / development.log的版本HEAD留在树中。
我有.gitignore
答案 0 :(得分:5)
删除并提交。
git rm log/development.log
git commit -m "Removed development log file which was supposed to be ignored."
git push
现在检查并确保您的.gitignore
文件设置正确。
touch log/development.log
git add log/development.log
你应该从git获得这个回复:
The following paths are ignored by one of your .gitignore files:
log/development.log
Use -f if you really want to add them.
fatal: no files added
如果您没有这样做,则您的.gitignore
文件不正确。如果你得到了正确的输出,那么某人可以提交日志文件的唯一方法就是他们改变了他们的.gitignore(在本地或用全局core.excludesfile
覆盖忽略)或者他们使用-f
切换到强迫它。