add_action('wp_footer', function () { echo ''; }, 99);
add_action('wp_footer', function () { echo ''; }, 99);
The post install and configure <strong>git-ftp</strong> on windows OS with easy step by step guide appeared first on Coding Sips.
]]>It uploads files to server in the same way GIT works, it creates a log file on your server and keeps track of commits or file you have changed, on upload it uses GIT to determine which files are changed or newly created and uploads only those files. it provides us the following ease and advantages over FTP clients like filezilla
To start these steps you need GIT installed, if not already installed download it from git-scm.com/downloads and install.
After installing GIT, got to its program files, for me it is located at
//git program folder path
C:\Program Files\Git
where ever this folder is, just note the path we will have to use it in the following steps
Goto start menu type and search git bash right click on it and select Run as Administrator
type the following commands line by line and enter
cd /c/"Program Files"/Git
git clone https://github.com/git-ftp/git-ftp git-ftp.git
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
GIT-FTP installed, Now lets see how to configure it with our repository
Create local git repository, it will work even if not linked to online git or bitbucket repository.
it will create .git hidden folder at your project folder
To save ftp credentials open CMD, goto root of your project folder eg (c:/wamp/www/myproject)
type the following commands replacing ftp_host, username and password with your ftp credentials
git config git-ftp.url ftp://ftp.yourdomain.com/public_html/whatever_path
git config git-ftp.user ftp_username
git config git-ftp.password ftp_password
we are all done to configure git-ftp for our project, now let see how can we upload files.
As I have mentioned above that git-ftp works with GIT and it creates a log file at your server. that log file is created for the first time once, so we have a bit different upload command for first time.
As git-ftp uses GIT so we have to commit our changes before uploading
Open CMD and goto your project directory eg (c:/wamp/www/myproject)
git add .
git commit -m "files changes"
git ftp init
it will upload all files and folders of your project
check your website all file will be uploaded
Now on-wards as it has created log file so we have to upload only those file which are changed so we have to write git ftp push instead of git ftp init let try
make some changes in your code
git add .
git commit -m "files changes"
git ftp push
This time with push it will upload only those files which are changed, it will be displaying which files are uploaded.
check your website new changes will be uploaded
As we learnt above that we will have to run git ftp init for the first time and it will upload all files (except those mentioned in .gitignore)
But what if we have already uploaded our files to server via some other FTP client and this time we do not want to re-upload all files with git ftp init?
And we will also be not able to directly run git ftp push as there is no hash uploaded at server to track the changes.
here is the solution, instead of running git ftp init run git ftp catchup
git ftp catchup creates log file at server to save hash for tracking changes and do not upload any file, after running this command we will be able to make changes and run git ftp push to upload only changed files
Hope this helped you, I encourage you to please write your valuable views and experiences about this topic in comments to share with other developers and friends.
The post install and configure <strong>git-ftp</strong> on windows OS with easy step by step guide appeared first on Coding Sips.
]]>