文件WindowsFormsControlLibrary/Properties/licenses.licx位于我的本地存储库中,错误地位于远程存储库中。
我把*.licx in .gitignore文件。
当我使用命令git pull时,我得到这样的消息:
error: Your local changes to the following files would be overwritten by merge:
WindowsFormsControlLibrary/Properties/licenses.licx
Please, commit your changes or stash them before you can merge.正在中止
我执行一次提交,并执行以下操作:
$ git rm --cached WindowsFormsControlLibrary/Properties/licenses.licx
$ git --skip-worktree WindowsFormsControlLibrary/Properties/licenses.licx
$ git --assume-unchanged WindowsFormsControlLibrary/Properties/licenses.licx
$ git reset --hard HEAD但当我使用git pull时,消息是相同的。
如何在不合并licenses.licx文件的情况下使用git pull?
发布于 2016-02-08 20:25:39
你在本地更新.gitignore了吗?如果是这样,您必须检查全局gitignore文件的内容,这有时会影响您的本地gitignore。
发布于 2016-02-08 21:10:16
执行git reset --hard HEAD时,撤消了从缓存中删除许可证文件的操作。再次执行git rm --cached WindowsFormsControlLibrary/Properties/licenses.licx,然后执行git commit。
为安全起见,请在执行下一步之前备份本地licenses.licx文件。
当你做下一次提取时,你会得到一个合并冲突,因为你已经删除了文件,而同时其他人明显地改变了它(否则你不会得到原来的错误)。使用"mine“解析它(或者简单地再次从缓存中删除它),然后提交。
请注意,当其他人执行git pull时,这将删除他们计算机上的licenses.licx文件。
https://stackoverflow.com/questions/35268419
复制相似问题