Ole Andreas Hansen
Ole Andreas Hansen

Reputation: 11

Git with test and production on same server

I'm just starting to know Git and its usage and now I want to try it out for a simple project. Since this is a small project I can't have two servers (one for test and one for production) so now i have a production folder (with all files in the project) and a test folder (copy of prod folder) on the same server.

Is there any way that I could use Git so that I can do changes in the test folder, commit and then push the changed files to the production folder?

Upvotes: 0

Views: 143

Answers (2)

Code-Apprentice
Code-Apprentice

Reputation: 83517

You can set up two Git repositories. One that is for production and the other is for development and testing. When you are ready to publish your development code to production, just push to the production repo. For more information, look at configuring remotes (which don't necessarily have to be on separate machines).

Upvotes: 0

duffymo
duffymo

Reputation: 308733

I don't see how Git should know or care about test or production.

I'd have one Git instance, with different versions of code in test and production, not different Git instances per environment.

Upvotes: 1

Related Questions