I have a DEV server running our CMS and I would like to pull from and push to a repository in the CMS install – but I get errors because I’m trying to push to a non-bare repository (I’ve cloned this remote repository locally).
But from what I understand, a bare repository doesn’t actually contain files which is obviously going to be a problem for viewing the CMS – not sure if this is correct?
Sorry if this is easy, I’ve been reading a lot of answers here but am still having trouble understanding how to set up my local and remote repositories when the remote needs files in it.
Also, I’m using Tower as I’m not too hot with git in the command line.
Any help or suggestions would be much appreciated.
Cheers
Ben
Using Git to manage a web site has a good run-down on how this is done.
The idea is to push to a bare repo (one that does not have a working directory), and checkout to your web folder in a
post-receivehook. Once you have that, you can push your updates to the bare repo with a simplegit push <remote_name>, and that will update your web root.With that setup you have:
That keeps the git stuff out of your web root, so that it contains only your CMS files. Makes things cleaner.