Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git/ftp workflow logic

Let me preface this by saying I am extremely new to git but have a basic understanding of Source Controls.

Here's my situation. I currently use a regular shared hosting account with a basic hosting provider similar to hostgator and use ftp/cpanel. I use ftp to upload/download files from the server.

I have recently installed git on my Mac as well as Tower (Git Client for Mac) and I plan on using github to host my repository.

Let's say theoretically when I go to push files to my repo, I want to update the live files on my webserver as well to match. What's the best way of doing this?

Should I just FTP the whole repo to my host? I would imagine that this could have potential problems such as changing file permissions or something else unforeseen.

I feel like I'm missing something in the process. Is there a way for me to deploy my local copy of the repo to my web server? Will I need a hosting account that offers ssh or terminal access to do this?

Should I be creating some sort of a hook.

Any info would be appreciated.

like image 979
bigmike7801 Avatar asked Feb 10 '26 16:02

bigmike7801


1 Answers

For just uploading/syncing git repo via ftp you can use git-ftp

It is pretty easy to use ... all you do to upload once you are configured is :

git-ftp push

but the fastest way to do so will always be via ssh using rsync with exclude .git.

[dev@dev_server website_repo]$ rsync -avz --exclude ".git" * dev@production_server:/var/www/mywebsite/.
like image 62
rohtakdev Avatar answered Feb 12 '26 14:02

rohtakdev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!