How to set up a repository using git-ftp?
12,603
Solution 1
You have to setup a git repositor first:
Enter your Project directory:
cd my/Project/
Init a git repository on it:
git init
git add .
git commit -m "Initial commit"
Configure you FTP:
git config git-ftp.user demouser
git config git-ftp.url ftp.example.com/demofolder
git config git-ftp.password demopassword
Init the git-ftp client:
git ftp init
Push your changes to FTP:
git ftp push
Make your changes and commit:
git add someFile.html
git commit -m "Added someFile.html"
Push your changes again and only what have changed is pushed:
git ftp push
That's it.
Solution 2
I found a ftp git tool which is much easier to use: Ftp-Git. It's a GUI ftp deployment tool which can push changed files in git repository to your ftp server. (All in a GUI way)
Author by
Naghi Attila
Updated on August 03, 2022Comments
-
Naghi Attila almost 2 years
I'm a newbie so please explain how to set up a repository?
I installed git-ftp.
I tried :git ftp init -u my_User-p my_Pass - ftp://host.example.com/public_html
but I got this error message :
fatal : Not a git repository (or any of the parent directories): .git
fatal : Not a Git project? Existing .... -
Naghi Attila over 10 yearsI followed the tutorial from this website anantgarg.com/2013/09/25/git-ftp-for-windows and finally it worked, but i can I pull/push/commit now ?
-
kds over 10 yearsI believe initially you have not used the git ftp init. Good that it works now. Also Im no clear on your question.
-
Naghi Attila over 10 yearsmy question is now using an IDE (e.g sublime text) how can i commit/push/pull data ?
-
Phil Ricketts about 2 yearsThis worked for me. FTP is a bit slow, especially for uploading thousands of files. I'd recommend uploading a zip and extracting on the server for initial commits, then use
git FTP push
often with this slow speed in mind, it's not so bad for smaller commits. -
Muhammad Wasim Akram about 2 yearsYes. Its very usefull for daily bases activites. Like if you worked on 100 files , you just push on git and simply run git ftp push command. And they will also present on Cpanel. Its pretty cool