📜 ⬆️ ⬇️

Git FTP example on Windows

This post is for those who have already mastered a bit of GIT, and wants his life to be even easier, and the performance is better! Those. Push immediately to an FTP server that does not have SSH access.

To work with the console, I used Git Bash.

I divided the post into several stages:
  1. Install Git-Ftp
  2. Checking the installed Git-Ftp
  3. Repository setup
  4. Use, upload to FTP server

1. Installing Git-Ftp:


$ git clone https://github.com/git-ftp/git-ftp $ cd git-ftp $ chmod +x git-ftp $ cp ~/git-ftp/git-ftp /bin/git-ftp 

')

2. Checking the installed Git-Ftp:


 $ cd ~ $ which git-ftp /bin/git-ftp $ git-ftp --help 

If everything was completed without errors, then the installation, passed as planned.

3. Setting up the repository:


Application to the project:
 $ cd /c/OpenServer/domains/site-name $ notepad .git/config 


Add to the opened config the following:
 [git-ftp "test"] user = _ftp_ url = 255.165.35.35/www/site-name.com password = _ftp_ 

url is the IP address / path to the repository on the ftp server
test - the name of the config, which will indicate to which ftp-server updates will be downloaded. You can specify several.

It is not necessary to perform a label stating that fresh updates have already been downloaded to the server. In this case, git-ftp will only update newly modified files.
 $ git ftp -s test catchup 


4. Use, upload to FTP server:


 $ git add . $ git commit -m "Commit name" $ git ftp -s test push 

test - the name of the ftp-config, which we specified in the Git settings.

But in general, that's all. When editing files, repeat the procedure from step 4 to update files on the server.

Source: https://habr.com/ru/post/178067/


All Articles