开发者

Trouble understanding how best to setup the bare repository with CMS on server

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开发者_JS百科.

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-receive hook. Once you have that, you can push your updates to the bare repo with a simple git push <remote_name>, and that will update your web root.

With that setup you have:

  • Your local repo - completely normal git repo you can work in
  • The server's bare repo - all the git data, but no checked out files
  • The server's web root/CMS folder - not a git repo, but contains one checked out revision.

That keeps the git stuff out of your web root, so that it contains only your CMS files. Makes things cleaner.


Hi I agree with you that getting you head around git is a steep learning curve. Having been through it in recent memory. We had a guy called Jerremy skinner who knows his stuff - his video guide to getting going with git is here http://www.ava.co.uk/git - the first one is about 5 mins.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜