11

For a project I'm working on, I want to use:

git add . -A

to add some files to the stage. The problem is that Git thinks these files are unchanged from the last commit, so they are ignored. However, I personally changed the file, but Git still sees the file as unchanged.

How can I "forcefully" add that single file to my repository?

4

2 回答 2

4

似乎assume-unchanged为该文件设置了 -bit 。设置该位后,git 将不再查找该文件的更改。通过键入以下内容取消设置:

git update-index --no-assume-unchanged <file>

之后,git status以及git add应该检测更改的文件。

于 2013-09-09T12:23:28.503 回答
4

检查您的.gitignore文件,必须有一些与此文件匹配的模式,该模式将文件排除在暂存之外。或者您可以使用git add . -f来强制添加这些文件。

于 2015-12-26T20:13:02.370 回答