I’m new to git and am confused by the documentation.
I’ve successfully set up a repository and can change and commit just fine. However, I’m still lost on how to push my repository to my server. Does the other server need to have git on it as well?
Basically, my company has an installation of magento which will be going live, I recommended we set up another server with version control before going live. What would be the best way to do that using git?
May I present… Git and Magento 101! Gitgento!
Since it looks like you’re midstream with your project, you might need to cherry-pick advice here and apply it to your situation.
First things first – get your Mage
.gitignorefile going. I use this one from GitHub.Second – under ideal circumstances (which you may or not have), I highly suggest you check in a working, vanilla install of Magento to the
masterbranch. That way when an update comes out, you can checkout the master branch and try to upgrade from there without your modifications. Then, consider creating branches for your staging servers. In my personal experience, we’ve setup three servers,prod,dev, andstage– each has a copy of the repository on it, and each runs git.Third – you’re going to need a central repository to communicate between the servers. Consider gitolite (gitosis isn’t updated anymore), as it will act as the “remote” repository and allow you to have some control over who (and what) can access the code base, down to the branch level. Get that setup and take a look at how you can leverage git-hooks to synchronize your servers automatically.
Don’t be afraid to house the repository on your production server – just be sure to disallow access to the
.gitdirectory, otherwise your repo will be out in the open. Hope this helps!