git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: file permissions in Git repo

From
Jeff King <peff@peff.net>
Date
Jan 17, 2014, 02:26 UTC
Message-ID
<20140117022623.GC12444@sigill.intra.peff.net>
In-Reply-To
<1389916737.92225.YahooMailNeo@web124906.mail.ne1.yahoo.com>
On Thu, Jan 16, 2014 at 03:58:57PM -0800, SH wrote:
Show 5 quoted lines
> We have a repository which holds lots of shell and perl scripts. We add the
> files to repository (from windows client) with executable permissions (using
> cygwin) but when we pull that repository on another machine (windows or linux),
> files dont have executable permission. Can you please provide a solutions for
> this?

Git does not preserve file permissions _except_ for the executable bit. So this should be working.

However, I suspect that `core.fileMode` is set to `false` in your repository, which causes git to ignore the executable bit. When a repository is initialized, we check whether the filesystem simply creates everything with the executable bit. If so, we turn off core.fileMode for the repository (since otherwise every file would have it set).

-Peff
Previous: SHNext: Torsten Bögershausen
Message 2 of 6 in “file permissions in Git repo”
  1. SHJan 16, 2014
  2. Jeff KingJan 17, 2014
  3. Torsten BögershausenJan 17, 2014
  4. SHJan 17, 2014
  5. Torsten BögershausenJan 17, 2014
  6. SHJan 17, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.