git and filemodes

Jim Garrison jhg@jhmg.net
Mon Dec 27 23:17:13 GMT 2021


On 12/27/2021 3:13 PM, Adam Dinwoodie wrote:
[snip]
> This is normal Git behaviour: it doesn't record detailed file
> permissions, only presence or absence of an executable bit. It only
> ever shows  file permissions as 644 (meaning "not executable") or 755
> (meaning "executable").
> 
> Specifically, the committed version of your .gitignore file is not
> executable, but the version in your current working copy is
> executable. This is a common side-effect of checking the repository
> out using Cygwin's Git, then accessing the repository with native
> Windows programs, which includes Git for Windows. Cygwin emulates the
> *nix approach of not setting the executable bit unless it's necessary,
> whereas native Windows programs almost always set the executable bit
> on any file they touch in common with normal Windows application
> practice.
> 
> If this behaviour is undesirable for you, I'd recommend either
> sticking to using Cygwin editors, or running `git config core.fileMode
> false` to instruct Git to ignore the executable bit on the filesystem.

Thanks for the detailed explanation, that makes perfect sense.

-- 
Jim Garrison
jhg@acm.org


More information about the Cygwin mailing list