我将一个
对
根据我的要求,我不想使用
Web.config
文件添加到我的 .git/info/exclude
中。我执行了 git update-index --assume-unchanged path/to/Web.config
命令。我还尝试了运行命令 git update-index --skip-worktree path/to/Web.config
。尽管如此,当我运行命令 git ls-files -v . | grep ^S
(它应该列出那些被忽略的文件)时,我没有看到 Web.config
的名称在其中。对
Web.config
的更改不会显示在 git status
中。但是,当我在更改 Web.config
后尝试切换分支时,我会得到 "Your local changes to the following files would be overwritten by checkout:" 的警告。根据我的要求,我不想使用
.gitignore
文件并且也不希望使用 git rm --cached
命令删除 Web.config
,因为这两个方法都需要我做提交。在我当前的情况下,这是不可行的选择。