Lewis Bassett
Lewis Bassett

Reputation: 1299

What different Git repositories do I need?

I am using the downtime over Christmas to set up an affective development environment and workflow that will serve me well as my business increases. I maily do PHP development..

At the moment:

Local Development I have NetBeans on my Windows PC. I have Apache, MySQL, PHP, etc. all installed for local development and testing purposes. I have integrated it all with NetBeans, and I have PHPUnit and Git integrated too. It seems to be working great and I now have my own local repository on my PC.

What I plan:

"Master" Repository I want to have the same sort of development environment on my laptop, so I can work away from the office. My plan is the have a repository on my VPS for each project (at some point, I'll start deploying dedicated repository servers), that I can upload changes at the end of each work session. In the morning, I'll just download them changes into my local repository and upload any work done at the end of the day. This will serve as a sort of "official" project history, and when I work with other developers, they will work with this too.

Production Repository I want a repository on my VPS, in the "live" area for my applications. I would like to be able to send out approved and tested changes from the "master" repository to this one when those changes are ready, rather than FTPing files.

Am I going the right way about this? Are there any guides to setting up this sort of thing?

Upvotes: 2

Views: 90

Answers (1)

Andrew Marshall
Andrew Marshall

Reputation: 96954

Why do you need a production repository at all? For you to actually utilize it, it would have to not be a bare repository, and you cannot push to the checked-out branch of a repository anyway.

I think the better solution is to have a "production" or "stable" branch in your repository that contains whatever you want to be in production. Then you checkout that branch in your production environment. Whenever you want to deploy something to production, you merge it into that branch, push it to your repository, and then in the clone you have on your server, pull.

Upvotes: 3

Related Questions