Reputation: 11
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
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
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