<分区>
我有一些文件不想在我的存储库之间共享。我将它们添加到项目根目录下的 .gitignore
中:
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
# ...
.idea/
然而,当我使用 git pull
pull 远程更改时,我不断收到此错误:
error: Your local changes to the following files would be overwritten by merge :
.idea/workspace.xml
Please, commit your changes or stash them before you can merge.
Aborting
我已经看到一些关于此错误消息的问题,但它们是关于覆盖文件的。我想忽略这些更改(我根本不想让 git 跟踪它们,也不想让 git 更改我的本地文件)。
我做错了什么?也许问题是我创建了 .gitignore
文件 after 我已经提交了我想忽略的文件,我需要以某种方式将它们从 repo 中删除......?