git always make some files modified

Christian Stimming christian at cstimming.de
Sat Dec 27 15:16:56 EST 2014


Am Samstag, 27. Dezember 2014, 09:22:12 schrieb John Ralls:
> > Following files are always marked as modified in my repos when swtich
> > between maint and master back and forth, sometimes these modified
> > files prevent git from git-checkout, meanwhile they cannot be stashed
> > or checked out with `checkout --`.
> > 
> > modified:   doc/README-de.win32-bin.txt
> > modified:   doc/README-fr.win32-bin.txt
> > modified:   doc/README-it.win32-bin.txt
> > modified:   doc/README-nl.win32-bin.txt
> > modified:   doc/README-zh_CN.win32-bin.txt
> > modified:   doc/README-zh_TW.win32-bin.txt
> > modified:   doc/README.win32-bin.txt
> > modified:   doc/examples/downloaded.mt940
> > 
> > I searched archived mails in gnucash-devel, set `git config --global
> > core.autocrlf input`. However, this only affects the first time when
> > checkout branch from master to maint. Above issue happens again when
> > checkout back to master from maint. Really confused, have no idea why
> > this happens and not sure whether it's an CRLF-related issue.
> 
> Those files' line endings are supposed to be controlled by .gitattributes,
> which overrides the core.autocrlf setting. 

Yes, the .gitattributes file is the other source of CRLF-related settings. I 
think 1-2 years ago it took me a while to discover how to get rid of this same 
"modified: doc/README...txt" message. I got stuck in those message when 
switching between master and some older branch such as maint or even older.

My solution is as follows:

- Remove the .gitattributes file
- Commit this removal into git (which makes the modified-message go away),
- And reset the master branch back to the original master.

It still sounds a bit funny to me, but this somehow works to get rid of those 
error message.

> README.win32-bin.txt and downloaded.mt940 don't have BOMs.

Yes, byte order mark (BOM) is the wrong keyword here - we are only talking 
about line endings, not byte order.

Regards,

Christian


More information about the gnucash-devel mailing list