1
我标志着一个本地文件不变通过更新索引,使用假设本地文件后合并:Git的 - 无法更新索引不变
git update-index --assume-unchanged <file1>
虽然,file1
存在于远程仓库。现在,当我试图通过合并远程分支:
git checkout myBranch
git merge origin/myRemoteBranch
我得到它说的错误:
error: Your local changes to the following files would be overwritten by merge:
file1
Please commit your changes or stash them before you can merge.
Aborting
我不能提交或藏匿任何东西,因为git status
说:“没什么可提交”标记为file1
为assume-unchanged
。如何将远程分支合并到本地分支并保持file1
的本地更改未被跟踪。
这听起来像是一个解决方案,但是当我更新我的分支上的'.gitignore'后来最终被合并到'master'时,我不希望'master1'上的'file1'被忽略。为了更清晰地编辑我的问题。 – shubhamsingh