git-ftp icon indicating copy to clipboard operation
git-ftp copied to clipboard

git ftp init does not preserve file permissions

Open wferi opened this issue 6 years ago • 6 comments

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

wferi avatar Jul 26 '17 18:07 wferi

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.

mkllnk avatar Jul 27 '17 09:07 mkllnk

Was this ever added?

n10000k avatar Jun 07 '18 12:06 n10000k

No, nobody has added that.

mkllnk avatar Jun 09 '18 03:06 mkllnk

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?

ethanbeyer avatar Feb 21 '19 17:02 ethanbeyer

+1 for preserving file permissions :-)

Antimon2000 avatar Oct 05 '19 09:10 Antimon2000

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.

davidwebca avatar Sep 17 '21 19:09 davidwebca