Note that there are some explanatory texts on larger screens.

plurals
  1. POGit changes the permissions on a single file unexplainably
    primarykey
    data
    text
    <p>I am the only person involved with this git project. Every time I edit files at my local Ubuntu repository, then push to Bitbucket and pull to my production repository, git changes the edited files to -rwxrwxr-x 775. Apache doesn't like this.</p> <p>Local system: git version 1.8.1.2 on Ubuntu Linux</p> <p>Production system: git version 1.7.12 on CentOS/Red Hat Linux</p> <p>When I fix permissions to 755, then do</p> <pre><code>git diff </code></pre> <p>or </p> <pre><code>git diff -p </code></pre> <p>It shows nothing.</p> <p>At my local repository, the permissions are 755 and the files are all owned by haws. At my production repository, all other permissions stay at 755, and all files including contact.php are owned by my username.</p> <p>At both the local and the production repository, I changed core.filemode as follows in an attempt to stop this behavior, </p> <pre><code>core.filemode = false </code></pre> <p>I've had mysteries like this in collaborative projects, so I'd really like to understand what's happening.</p> <ol> <li>What can I do to see git's reason for changing the permissions of this file?</li> <li>How can I get git to stop changing it?</li> </ol> <p>I have also tried to find the solution here: <a href="https://stackoverflow.com/questions/12733452/prevent-git-from-changing-permissions-on-pull">Prevent Git from changing permissions on pull</a> to no avail.</p> <p><strong>My Final Solution (thanks to VonC's guidance):</strong></p> <ol> <li><p>Thanks to VonC's good explanations, I was brave enough to figure out that every time I was logging into my server, my umask was going back to 0002. So I created a user startup script (.bashrc or in my case .bash_profile) at my Linux host that sets</p> <p>umask 0022</p></li> </ol> <p>or using symbolic notation (for a little added value)</p> <pre><code>umask u=a,g-w,o-w </code></pre> <p>or</p> <pre><code>umask u=a,go-w </code></pre> <p>(Allow all permissions for user, disallow write permissions for group and others)</p> <p>That solved my issue.</p> <ol start="2"> <li>I had previously set git config core.sharedRepository true, but that was not my issue, and I removed the setting once the issue was resolved. </li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload