I am struggling to get GIT to replace FileZilla.
The basic idea is to a GIT Server on my Domain Server a URL.
REMOTE SERVER Directory Structure
LOCALHOST SERVER Directory Structure
How do I setup Git on the REMOTE SERVER so that I am able to Git clone into the LOCALHOST directory structure.
REMOTE SERVER and LOCALHOST
- Set git user:name, user:email and user:password
- git init
- git status
- git add .
- git commit -m “message goes here”
I am able to “git clone userName@URL-001.com:/var/www/public_html” OK but…
when I make changes to the LOCALHOST /home/john/URL-001/public_html/ the changes are added and committed OK but cannot be pushed?
I found this tutorial very useful when I was trying to do the same thing: https://www.digitalocean.com/community/tutorials/how-to-set-up-automatic-deployment-with-git-with-a-vps
The nice thing about the setup described is that the files are deployed separately from the git repo itself, which is cleaner.
Many thanks for the link. I tried the tutorial but still could not get git to work.
I have managed to solve one of the problems which was due to the online file not having shared access. A new installation now created with the following:
git init --bare shared=true
That managed an extra step on the ladder and can now locally git clone … the online repository files and directories and upload the local changes:
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 295 bytes | 295.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
ad41a71..50e8400 master -> master
BUT where they go nobody knows The online files do not change.
Enough for one day, hopefully continue tomorrow.
Removed duplicated text.
I tried again and was delighted to get it to work. Paths were the problems and misleading error messages, which I Googled and dug myself deeper into a hole with an unfathomable depth
Working on my LOCALHOST requires opening a Command Window, navigate to the project folder:
- Setup git // https://git-scm.com
- git clone
<online site> // only required once to download all the online files
- git add . // notice the trailing period to initially add ALL files to the project
- Locally edit (and create new files and/or folders)
- git status // to view only changes
- git commit -ma // to commit changes ready for uploading/pushing
- git push // to upload only modified files and folders
- Locally browse ONLINE site and view rendered changes
Further file modifications only require items 5 and 6 to upload changed files.
Upload process is virtually instant, far quicker than FleZilla. Goodbye ver-001, ver-002, ver-003, etc
Also I believe that working/editing files on another computer is possible. I have yet to investigate many of the numerous features, especially rollback to a previous version.
Git (not to be confused with https://github.com) is installed on the Linux Apache2 Ubuntu Remote Server and also on my working computer. Macs and Windows can also have a local Git installation and perform the same tasks to the remote server.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.