git-ftp
git-ftp copied to clipboard
set CHMOD of file after it has been uploaded
Is there a way to change CHMOD permissions once a file has been uploaded? If this cannot be done as for now, can someone point me in the right direction how could I implement it myself? maybe with a hook?
That is interesting. I'm guessing you are pushing from a file system that does not support permissions to one that does?
well, I have a small team deploying to FTP server (on Linux) we all work on Mac, and we had issues while deploying due to file permissions on FTP server (if another person created a new file and other wanted to upload a modified version of it), I thought this could be resolved if we could change the file permission once it has been uploaded to FTP server, but your answer got me thinking, and I just created a git hook to change file permissions to newly created files after a commit (to avoid messing with umask
at system level) I think this approach while not being close to be the best solution will be sufficient for our needs, thank you for your response!
Actually I just knew that the FTP server automatically changes the file permissions to 755 even if I upload one that is 777, and this is not something I can change on the server, so I think I will still need to change file permissions once they have been uploaded, is there a way to CHMOD a file everytime it gets uploaded?
There seems to be a way to do that with curl: https://curl.haxx.se/mail/archive-2008-03/0061.html
But it's not supported by Git-ftp. You could write your own post-push-hook to change file permissions.
Could this be marked as a feature request? It would be very helpful to be able to set default permissions in gitconfig per destination. Something like: chmod_d = 775 chmod_f = 664
how hard would implementing @swinggraphics' idea be?
Related issue: https://github.com/git-ftp/git-ftp/issues/379