Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
由于gitattributes eol设置,覆盖未分级的提交_Git_Eol_Gitattributes - Fatal编程技术网

由于gitattributes eol设置,覆盖未分级的提交

由于gitattributes eol设置,覆盖未分级的提交,git,eol,gitattributes,Git,Eol,Gitattributes,我有一个fork,由于.gittributes,它在克隆时会自动进行eol更改。这在上游是固定的。我想融入我的主人;然而,我无法摆脱这些未老化的变化。我不能重置,也不能隐藏它们,除非我遗漏了什么。如何将上游/master合并到master中,以覆盖这些本地未老化的“更改”?首先,您可以尝试 git reset --hard 以消除工作目录和索引中的任何更改。现在你应该可以 git merge --ff-only upstream/branchname 如果出于某种原因,git属性使它看起来有

我有一个fork,由于.gittributes,它在克隆时会自动进行eol更改。这在上游是固定的。我想融入我的主人;然而,我无法摆脱这些未老化的变化。我不能重置,也不能隐藏它们,除非我遗漏了什么。如何将上游/master合并到master中,以覆盖这些本地未老化的“更改”?

首先,您可以尝试

git reset --hard
以消除工作目录和索引中的任何更改。现在你应该可以

git merge --ff-only upstream/branchname
如果出于某种原因,git属性使它看起来有变化,但它不起作用,请尝试

git push . upstream/yourbranch:yourbranch
如果这起作用,你应该处于无头状态。即,您当前的提交未被任何分支跟踪

git checkout yourbranch
现在应该可以让你找到最新的了。如果这些属性仍然让您感到悲伤,请将
--force
选项添加到签出中


希望这能有所帮助

我尝试了这个方法解决我的问题,并重新设置了——我确实很努力地处理了这个有问题的文件。