What’s New In Tech?
June 25, 2021Laravel Livewire
July 5, 2021
Why use git-ftp?
If you use git and you need to upload your changes to an ftp server, git-ftp saves you the troubles of identifying which files you changed and then uploading each individual file. Git-ftp uploads only the files that have changed. Once setup it is simply 1 line to deploy your changes.
How to setup Git-ftp?
- First you will need to have git installed. You can download git from here. If you have sourcetree or any alternative you will already have git installed.
- After installing note where your git was installed as you will have to use it in the steps below.
- Go to your start menu and search Git Bash, right click and select run as administrator.
- Then enter the below command, this is to check which git file we need to install git-ftp:
- which git
- If the response is /bin/git then follow the below steps:
- Then type the following commands by pressing enter after each line.
- If the response is /mingw64/bin/git then change the commands to the following:
- Now Git-ftp is installed and ready to be configured.
- Then enter the below command, this is to check which git file we need to install git-ftp:
Configuring Git-ftp
You will need to have either a local git repository set up or a remote git or bitbucket repository.
How to create a local repository?
- Hold in the windows key and press r, then type in CMD and press enter to open Command Prompt.
- Got to the directory your project is saved under by typing ‘cd’ and then the directory (eg. cd C:\Users\Rayne Eden Logan\Documents\myproject )
- Then type git init and press enter. This will create a .git hidden folder in your project folder.
Saving of ftp credentials:
- In your Command Prompt navigate to your project folder (as in the above steps 1 and 2) and type the below commands pressing enter after each line:
- Where ftp_host, username and password must be replaces with your ftp credentials
Using Git-ftp
If it is the first time you are running git-ftp then run the below commands:
After the first time your will then have to run the below commands:
If you did not save your ftp credentials you can run the below command when pushing your changes:
Happy Coding!