1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues


Issue #10071 closed

Bitbucket Alters File Permissions

Josh S.
created an issue

I push files up with correct permissions (644), but when they're pulled to the server they have incorrect ones (664).

To make matters worse, when I do a straight download of the repo from bitbucket.com to double check, the files come down as 755.

Comments (3)

  1. Kaleb Elwert

    Interestingly enough, the only permissions that git actually tracks is the execute bit. So, although 644 and 664 may seem different, to git they are the same. In the early days of git (nearly 10 years ago), all permissions were tracked, but as some systems would recreate the files with a umask, it proved to be more of an annoyance because every commit would change the permission on a bunch of files.

    This commit made git track only the executable bit: https://git.kernel.org/cgit/git/git.git/commit/?id=e447947

    We do not modify what we get from git, so permissions are handled by git directly.

    However, you mentioned that when you download the repo, the files come as 755. On OSX, the default unzipper appears to only use the umask to determine the permissions. If you use the command line tool unzip, the files with the correct executable bits are extracted. Please reopen if you still have trouble with this.

  2. Log in to comment