Deploying code to a production server from Git

I spent the past week reading Git and trying to figure out how to fit into our company. There is a lot of information, and among other resources I found the Pro Git book very useful. However, one thing that remains a mystery to me (this is also not in the book) is how to "link" the Git repository to our production servers.

Our current setup consists of one SVN server, which we fix (I found that this can be compared to setting up an open Git repository in a common place and clicking on it). Our production servers (there are several clients working with the same PHP code) are currently working copies of SVN, which we manually update one by one by running svn up .

What is the best way to approach this in Git? I thought about adding production servers as remits in my Git repository and clicking on them , but I think this could create confusion if different servers get different push histories (this will be one case when you really need to centralize it, I think). Or do you need to use a tool like https://github.com/mislav/git-deploy ?

I can't help but feel that the Git developers didn't really think about it. "I hope I missed something :)

+6
source share
1 answer

You can achieve the same workflow with git. Set up a smooth repo that you all click on your code and clone that repo on your production server. When something happened and you want to update your production repo, just do "git pull" instead of "svn up".

This is a good start to get things going. After a while, you might want to automate this, and you can do many cool things, for example. git.

+6
source

Source: https://habr.com/ru/post/910334/


All Articles