Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

maxgeraci's avatar

Git, Laravel and shared hosting

Hi,

I have my laravel website on a shared hosting. I did this by putting the files inside the public folder into the public_html folder and putting the remaining files into a self-made folder outside the public_html.

Now my question is, how do I combine this with Git? I'm working with branches on Git, but I basically want what's inside the master branch to be uploaded to the hosting. How do I do this? Because my local Laravel project and the Github project are ofcourse different than the live Laravel project. How do I do this and is there also a way to do this automatically? So whenever the master branch updates, the live Laravel project will automatically pull the new code changes from the master branch?

0 likes
8 replies
bobbybouwmann's avatar

You should look into Forge, it offers all of that for you ;)

Shared hosting doesn't have access to git, you can't pull your changes to the server that way. The only way is manually copying it.

With a VPS you have more control yourself and then you can use git and auto deployments, but like I said Forge supports this out of the box!

https://forge.laravel.com

1 like
maxgeraci's avatar

Hi,

I'm working on this project with a friend. Can we both use Laravel Forge with the Hobby plan? Because it says you can only share servers when you purchase the Business plan? $40 a month for something that's just a hobby between my friend and I is a bit too expensive for us.

bobbybouwmann's avatar

I know it's against the rules, but you can still use one single account. You have so share the email and password, but that way you can get started at least ;)

jlrdw's avatar

There are programs that will sync to an FTP account, I use syncback.

I'm on Windows myself but surely Linux has a similar sync software.

You only need to sync the app stuff not the framework stuff which is the vendor folder.

Any confusion on that part just look on GitHub and you will see the Repository for the framework, that is the vendor folder. Do not sync that not necessary.

This is just so easy Once you practice one time.

EDIT: Forgot to mention, you have to use mirror source to destination.

leume's avatar

highly recommended to use cloud hostings like DigitalOcean, AWS, Laravel Forge. shared hostings doesn't give you full opportunities to realize your project on production

Please or to participate in this conversation.