Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

git deploying project - file permissions - (chmod)

I'm deploying my project with git to a remote server using a post-update hook. More specifically I'm following these steps. Everything on my local copy has the right permissions, however after deploying with git push production, files that are set to 777 change in the remote server to -rwxr-xr-x

I've added to both (local/remote) .git/config the core variables filemode = false and I've changed as well my umask in /etc/profile to 0002

Any ideas why it keeps changing the mode of files? Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The core.filemode variable is only used when files are indexed. When git checks out files, the stored mode is used unconditionally, and files can only have a mode of 644 or 755. Modify your post-checkout hook to chmod the files.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...