简体   繁体   中英

What is the best way to setup a git server[using gitlab] where the repository is under public_html?

I want a way to setup a git server using gitlab on our development server so that when someone commits code it commits to the working copy under public_html.

I have looked at instances of using git inside public_html as a git client and pull from the same machine using cron. However this is not ideal and will not work for us.

What I have found so far is to change git_data_dir "/mnt/nas/git-data" in /etc/gitlab/gitlab.rb . But then the whole directory structure is copied.

Please understand that the repositories you push to (in gitlab and other hosted git servers) are bare repositories - they don't have a working copy. Thats why the normal workflow is to have a separate clone/working copy that gets updated on a commit.

Git repositories support hooks which you can use to perform a "git pull" in your public_html . That should get you settled. If no, please explain why "this is not ideal and will not owrk for us".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM