git-ftp
git-ftp copied to clipboard
git ftp init does not preserve file permissions
Bug
... at least over SFTP:
$ git init
$ git config git-ftp.user myuser
$ git config git-ftp.url sftp://my.serv.er/~www/foo
$ echo foo >bar
$ chmod +x bar
$ git add bar
$ git commit -m initial
$ git ftp init
Now the uploaded bar
has modes -rw-r--r--
while the one in my repository has modes -rwxr-xr-x
. Indeed:
$ git ftp download
$ git diff
diff --git i/bar w/bar
old mode 100755
new mode 100644
Environment
$ echo "$SHELL"
/bin/bash
$ uname -a
Linux lant 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux
$ git-ftp version
git-ftp version 1.4.0
Yes, I just looked into curl which is used by Git-ftp and it doesn't change the file permissions by default. For each file, we would need to check the file permissions and add a special command like -Q '-SITE CHMOD 755 bar'
. Thank you for pointing that out.
Was this ever added?
No, nobody has added that.
Is there currently any way to set permissions on files/directories by default?
I'm using git-ftp to deploy all changed files to a server, and when files get there, the permissions are 0600
. Is there any way to FTP those with -f 0644 -d 2755
or something?
+1 for preserving file permissions :-)
Bump? I'm running into an issue right now where the user that I access the server with is not the "web" user so the default permissions for this user are wrong (chmod + chown troubles). I would need to be able to chown switch and chmod change / set defaults.