Articles → Git → Upload Files On FTP Server Using Git-Ftp
Upload Files On FTP Server Using Git-Ftp
What Is Git-Ftp?
Install Git-Ftp
- Install Git (http://gyansangrah.com/gyansangrah/article/install_git_ubuntu).
- Once git is installed, open git bash as an administrator.
- Go to the path where git is installed using the following command (Normally it gets installed in c:\program files\git)
cd /c/"Program Files"/Git
- Use the following command to clone git-ftp
git clone https://github.com/git-ftp/git-ftp git-ftp.git
- Use the following commands to complete the installation
cd git-ftp.git && chmod +x git-ftp
cp /c/"Program Files"/Git/git-ftp.git/git-ftp /c/"Program Files"/Git/bin/git-ftp
Configure Git-Ftp And FTP Server
- Go to the folder where you want to create the working directory.
- Initialize git repository using the following command
- Set the FTP credentials
git config git-ftp.url ftp://ftp.yourdomain.com/whatever_path
git config git-ftp.user <ftp_username>
git config git-ftp.password <ftp_password>
Upload File On FTP Server
- Create a new file (or copy it from some other location) in the working directory
- Use add command to add the file in staging area
- Commit the changes
git commit –m “<message>”