开发者

Existing website on ubuntu that want to change to deploy using gitosis - process?

I have an existing directory on my webserver, currently deployed to by file copy, that I'd like to change to deploying with gitosis. How can I create a ne开发者_如何学编程w gitosis repository to point to this web directory and then clone it down to my local machine?


while Arrowmaster is correct in saying that Gitosis has been depreciated in favour of Gitolite there is nothing to say that you cant use git for web deployment, there are loads of people doing it including me. What you need to do is the following, get Gitolite setup and have a working installation whereby you can clone, push and pull into the repositories that Gitolite will create for you. Then it is just a matter of running git init in you existing web directory and then git add . to add all files to it. You then add a gitolite repo as a git remote and git push master into it so you can git clone it to your local machine make allowing you to make changes and push back to the live site.

Essentially you would have a hub repository (gitolite) and prime repository (web directory) these would be lined by means of hooks with within git. I have to point out though that I don't use hooks and manually pull from Gitolite (sudo git pull hub master) on the live machine as I'm not comfortable pushing to a live site in case I think of something I've forgotten.

I take no credit for this setup and owe all knowledge to Joe Maller for his very instructional guide here I have although obviously swapped git for Gitolite.

After a long time messing around and having some success with Gitosis I switched to Gitolite and haven't looked back. I have found it a lot less buggy and more stable in the push/pull permissions department.

I did however have some issues setting Gitolite up and I owe this tutorial a world of thanks for showing me the way forward. It is however for Centos but should be easily ported to Ubuntu.

If you do decide to go the gitosis route then maybe this tutorial will help you with the installation.

Good luck.

seanl


Gitosis is not ment to be used for website deployment, in fact gitosis is mostly deprecated now in favor of gitolite but that doesn't do website deployment either.

If you want to use git for website deployment you should either use a tool designed to do it, use a non-bare (from normal git init/git clone) repo on the server, or use a bare (from git init --bare) on the server with hooks to do the deployment (there are many different 'howtos' on the web for doing this but personally I think most of them are bad and don't do it in a way I would consider 'correct').

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜