开发者

Does GIT support push to an ftp server? [duplicate]

开发者 https://www.devze.com 2023-02-04 10:53 出处:网络
This question already has answers here: Git Push into Production (FTP) (15 answers) Closed 5 years ago. I believe git ftp support is a somewhat recent addition, but the git push docs do c
This question already has answers here: Git Push into Production (FTP) (15 answers) Closed 5 years ago.

I believe git ftp support is a somewhat recent addition, but the git push docs do clearly state that "Git natively supports ssh, git, http, https, ftp, ftps, and rsync protocols." (emphasis added)

However, others have asked what to do if git fails to push to ftp server, and I am having exactly the same problem.

So -- can anyone definitively state whether or not "git push" works with the ftp protocol?

I开发者_如何学Cf yes ... then can anyone answer that other question? :-)

If no ... is this in the works, or should I be looking at git-ftp?

I'm using git 1.7.3.1 under Windows.

Many thanks for any info or advice! (BTW, I had this question all nicely hyperlinked, but as a lowly 1-rank I only get one link, so had to remove the others ...)


No, Git does not support a push to an FTP server, only clone and fetch. This was previously answered.

But there are several tools to upload your code to an FTP server that work with Git.

  • Git-ftp - A shell script that uploads your current commit. It stores the last uploaded commit id and uploads only changed files.
  • ezyang/git-ftp - A python script that uploads commits as well. It comes with a post-receive hook to deploy from a bare repository. But the last commit is more than three years old.
  • PHPloy - A php script that also uploads only changed files by storing the commit id.
  • Grunt-git-ftp - A Grunt script that uploads only changed files as well.


I think you should use ftp-git, it's a GUI tool to push changed files in git repository to ftp server.

You can check the changed files in GUI way, and it can save your ftp connection details for future use.


In your other question, you seem to be using user@host in your FTP URL.

The docs don't mention user@ as being supported.


I don't know if this will work or not, but one thing to look at is .netrc support.

I know on windows, some people here put their HTTP login credentials in a netrc file so they don't have to specify it on the git command. Perhaps FTP can work similarly?

I'm on OSX, and that file sits in my home directory. I don't know where it goes on windows.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号