For an introduction to Git and how to install, please refer to the introduction tutorial.
This article will teach you how to use Git when you want to deploy your application. While there are many ways to use Git to deploy our application, this tutorial will focus on the one that is most straightforward. I assume you already know how to create and use a repository on your local machine. If not, please refer tothis tutorial.
When you use Git, the workflow generally is toward version control only. You have a local repository where you work and a remote repository where you keep everything in sync and can work with a team and different machines. But you can also use Git to move your application to production.
Our fictitious workspace:
Your server live directory: /var/www/domain.com
Your server repository: /var/repo/site.git
What should we do if we want to push to site.git and at the same time make all the content available at/var/www/domain.com? [Read more…]