I want to use git to manage my development, integration test and production environments. I've looked around but can't seem to find a simple explanation of how (eg Git - pushing to remote repository doesn't quite do it). A very brief explanation of what I want to do:
- I master my codebase on my laptop as that's where I do most of my work.
- I host my site on 1and1. On there, I have two sites set up, the production site and an integration test site.
- I want to set up git so I can have two remotes on my laptop, say siteprod and siteint.
- Whenever I have a branch I want to test, I want to push it from my laptop, say using "git push siteprod newproductionversion" (I'm sure you get the idea).
I've achieved something close by creating a repository on 1and1 using git --init (note without --bare!) and setting up the remotes using ssh. But I have to set receive.denyCurrentBranch to ignore and once I've pushed, I have to checkout the branch by logging onto the 1and1 server. I have to repeat it all for the integration environment.
This seems very clumsy but I'm sure my use case is not at all unusual. Is there a sensible way of doing this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…