I am very puzzled. I have read many sources about 'development & deploy' with git and haven't understand anything.
Now I have:
- Local (Development) repository with project (
git init) - Gitlab/Github Server where I store/commit/push my project.
- Production server
With local repository and gitlab/github server is all clear. I make changes and push to the server. Next, I need to deploy it to the server and here is the question 'How to do it correctly'?
Many sources writes that I need two repositories on production server:
- Bare
git --bare init - And non-bare repository in
/var/wwwfolder

Then I need to push changes from my local/development repository to Bare then pull project in /var/www from this Bare repository.
But if I have Github/Gitlab Server then I don't see logic in this Bare repository, because I have this code on the server. I'm right?
I am using Laravel for my projects and after some commits composer install is required. If I pull this commit on production server, then it may break site and it will be down for some time until I will make all required steps. Of course all steps can be done with automatic script, but I think it also will break site for a short time.
I want to understand right scheme of deploying applications to production server.
