简体   繁体   English

git bisect与CRLF / LF结合使用

[英]git bisect in combination with CRLF/LF

I am trying to git bisect some bad behavior in a public repo. 我试图将公共git bisect一些不良行为git bisect部分。

The repo has: 回购包括:

  • some commits with CRLF (I am on MacOS, so expecting LF) 一些提交CRLF(我在MacOS上,所以期待LF)
  • a .gitattributes file in its root, normalizing .c, .h, and .java files 根目录中的.gitattributes 文件 ,规范化.c,.h和.java文件

As I understand it, none of the present .git/config or ~/.gitconfig should matter, as .gitattributes has precedence. 据我了解,目前的.git/config~/.gitconfig都不重要,因为.gitattributes具有优先权。

My problem relates to this: when I do a checkout of a commit with CRLF, the local files are modified with LF. 我的问题与此有关:当我使用CRLF检查提交时,使用LF修改本地文件。 These files show up as modified upon git status . 这些文件在git status显示为已修改。 Then if I try to check out another commit, git refuses in order to protect my local changes. 然后,如果我尝试检查另一个提交,git拒绝以保护我的本地更改。 Fine. 精细。

In the checkout case, I can force it with -f , and go on. checkout情况下,我可以用-f强制它,然后继续。

The problem is that I cannot seem to force git bisect skip . 问题是我似乎无法强制git bisect skip If I try, git tells me to stash changes. 如果我尝试, git告诉我存储更改。 I cannot get clean working files (stashing leaves me with modified newlines anyway), and I cannot skip. 我无法获得干净的工作文件(无论如何都会让我留下修改过的新行),我无法跳过。

I've tried copying over a temporary .gitattributes in order to make bisect leave the newlines unchanged, but then it complains about the changes in .gitattributes being unsaved. 我已经尝试复制一个临时的.gitattributes以使bisect保持新行保持不变,但随后它抱怨.gitattributes中的更改未保存。

Is there a way to force bisect ? 有没有办法强制bisect

none of the present .git/config or ~/.gitconfig should matter, as .gitattributes has precedence 目前.git / config或〜/ .gitconfig都不重要,因为.gitattributes具有优先权

not really, the local file for gitattributes is .git/info/attributes , and it has precedence over whatever .gitattributes file in repository 实际上,gitattributes的本地文件是.git/info/attributes ,它优先于存储库中的任何.gitattributes文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM