I am using git (1.8.3) on Windows. If I clone a repo from github, immediately check out another existing branch on that repo, git detects the modified files. Usually. This is sometimes not the case. And diff on all modified files is returned identically (including line endings). This problem was observed in two different repositories, at least on 4 different computers among my team.
And these are not always the same files, but they are almost always one of several subsets of files in rep. For example, sometimes these are the same 5 files in the root of the repo, sometimes they are the same 93 files in one particular folder, sometimes they are the same 16 files in another folder.
As soon as git has marked the files as changed, if I return them or run them, they will immediately be marked as changed again, which makes it impossible to switch between branches.
I have the feeling that it is connected to line ends, but I already added the recommended .gitattributes file and renormalized each branch, but I still have these sporadic problems. Another possibility that I was thinking about is merging between branches, somehow messed up the renormalization I did, but I donโt know how to test this theory.
We all have core.autocrlf=true
, since we are all on Windows. Here are our .gitattributes
# Auto detect text files and perform LF normalization * text=auto # Custom for Visual Studio *.cs diff=csharp *.sln merge=union *.csproj merge=union *.sqlproj merge=union *.html text diff=html *.css text *.js text *.ejs text *.sql text # Standard to msysgit *.doc diff=astextplain *.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain *.pdf diff=astextplain *.PDF diff=astextplain
source share