0

I created a git repo on my hostgator dedicated server and pulled the new repo to my local machine. I am able to push changes up to the server fine, but file permissions get changed to 0664 while all the other unedited files are 0644. Some files with 0664 permissions throw a 500 internal server error until I change them to 0644.

Is there a way I can tell git to always use 0644 instead of 0664?

I am on Git v. 2.30.1

Mike Volmar
  • 1,927
  • 1
  • 22
  • 31
  • When you say "push changes up to the server", what do you mean exactly? The "git push" command doesn't interact with individual files, only _commits_ and _branches_, and would generally not be used to publish changes to a web server. It's more likely that the actual transfer to the server is unrelated to git, and using some form of FTP connection. – IMSoP Jun 14 '21 at 19:10
  • git push origin master – Mike Volmar Jun 14 '21 at 19:52
  • I added my public key to the server so I enter a passprase when I push – Mike Volmar Jun 14 '21 at 19:53
  • As I say, "git push origin master" is a command to synchronize commits and branches between two git repositories (typically, a local copy and one on a service like Github used for collaboration); it doesn't have anything to do with individual files or permissions. So the description of a git push "changing permissions", and the mention of a a "hostgator dedicated server" don't make much sense in context. – IMSoP Jun 14 '21 at 20:02
  • Git does not store file permissions, at least not in this particular way. (Git stores one bit per file: "executable" or "not-executable". It has no option to store group write permissions. It *did* have that, way back in the distant pre-Git-1.5 past, but has not had that since 2005.) – torek Jun 15 '21 at 12:11
  • Your system has some kind of "push-to-deploy" setup that takes the pushed commits and extracts particular files from them and deploys them. This is where the permissions come from: the deployment system you're using. Investigate *that*, as it is the source of the issue. – torek Jun 15 '21 at 12:13

1 Answers1

0

files coming in from cpanel user ... nonsystem user, a.k.a git push, so umask changed them to 664. updating default for cpanel user from 002 to 022 fixed issue. thanks for the comments.

Mike Volmar
  • 1,927
  • 1
  • 22
  • 31