How to deploy files from a git repository via FTP
https://www.zyxware.com/sites/default/files/styles/user_image/public/default_images/index.png?itok=dkp9qUXZ
BY meera.l
6 years ago
Technical-Solution

Git is very popular guy in the world of version control systems and it is distributed by nature Without using a VCS, handling a project's multiple versions will get you in trouble very often. If multiple people are working on same project, this may be thousand fold. But if your client's service provider only gave you ftp access and it happens quite often, so you have to handle the project without the help of git. But we can track files easily using git-ftp, without having ssh access to the server.

Steps to install git-ftp

Clone the git repo of git-ftp into your system

git clone https://github.com/resmo/git-ftp.git

Install git-ftp, using the following commands


cd git-ftp
git checkout master
sudo make install

Also make sure that curl is installed in your system. Now let us just walk through the topic how to use git ftp. We can divide the entire scenario into 3, they are initial deployment, maintenance and changes

Initial deployment

Inialize your git repo amd made your initial commit as usual. Now use the following command to push first time to your server using git-ftp

git-ftp init -u username -p - ftp://host.example.com/public_html

Git ftp is tracking the files by uploading the changed SHA1 name to the file.git-ftp.log.

Maintenance

If your server has uploaded files already and you have to track it using git-ftp, download all files and inialize git repo. Then use the following command.

git-ftp catchup ftp://host.example.com/public_html

This will upload .git-ftp.log file into the server and it will help to remember the current state.

Changes

If you modified the code and to add modified files in to the server, just add and commit those file in git way and run the following command.

git ftp push -u username -p - ftp://host.example.com/public_html

You can add default using git config as follows


git config git-ftp.user ftpusername
git config git-ftp.url ftp.hostname
git config git-ftp.password ftppassword
git config git-ftp.syncroot path/dir

After setting default, you don't have to bother about anything, simply run as git ftp push. Also you can add scopes and can add the files to be ignored by adding them into .git-ftp-ignore.

Reference:
https://github.com/resmo/git-ftp/blob/develop/man/git-ftp.1.md


RELATED ARTICLE

/themes/custom/zyxpro_light/images/placeholder.png
close

on 04th April 2007 / by webmaster
Linux is the epitome of the FLOSS model. Technical Solution Linux installation Dewey J. Corl (not verified) access_time 21 Sep 2021 - 09:06 Linux is not ready for the general public! (I am a Ubuntu user). For proof, 1. try to simply print labels on a Dymo label printer. It takes a LOT of work to get to the ease of label printing already available in Windows and Mac. 2. try syncing a modern Palm based PDA. Yes, jpilot and others will sync the main data, but pictures and midi files do not get transferred without a lot of extra setup. These are examples of applications that are not ready for the general public. Since an operating system only supports applications, Linux is not ready to be a common desktop for the general public. While we are waiting for the applications to catch up, keep up the good work!! Anoop John (not verified) access_time 21 Sep 2021 - 09:06 Dewey Yes you may be right. But these are not applications that a common man would use. A common man would use one of these applications - Internet browser, Chat Client, Email Client, Document Writer, Presentation Creator, Spreadsheet Editor, Movie Viewer, Music Player, CD/DVD Writer. Both examples you cited are more specific applications that only a small percentage of the whole population uses. It will take time before those hardware vendors identify the need from their perspective to address the Linux community. Krishnadas (not verified) access_time 21 Sep 2021 - 09:06 Dear Mr Anoop, Thank you very much for the free installation of LINUX done in my PC. I am getting immersed in the LINUX and seeing the versatility. To my surprise, I am able to read one of my old backup CD(wherein lot of my valuable file exist) done in DIRECT CD wizard (a custom cd writing software of Easy Cd creator in WIN98) which could not be read in XP. Installation of old version of easycd creator/direct cd program was not possible in XP. I thought that possible i lost all data. Very pleasant start! Srikanth N. S. (not verified) access_time 21 Sep 2021 - 09:06 Hi Anoop, My friend is thrilled with Ubuntu. One of his grouses with windows was that after OS installation, everything else is to be installed separately which is a real headache. WHereas if u install Linux, everything is installed as a package and he is thrilled to bits! Let linux installation spread in Trivandrum and your service in this direction is highly appreciated. Kepp up the good work Regards. PDA Freak (not verified) access_time 21 Sep 2021 - 09:06 Is it possible to install linux on a packardbell notebook ? webmaster access_time 21 Sep 2021 - 09:06 In reply to Is it possible to install by PDA Freak (not verified) Sir, It should be possible. Try installing and if it shows any issues please inform us. May be we could help you. Thank You Team Zyxware