Getting GitHub files (and updates) onto an Ubuntu web server

前端 未结 1 1412
迷失自我
迷失自我 2021-01-16 01:58

I\'m setting up a multi-user, multi-server environment. All developers will use Git and clone various repos from GitHub etc. (in one account I control).

Now, how do

相关标签:
1条回答
  • 2021-01-16 02:44

    How do most people get GitHub files to their web servers?

    Generally by pushing to a bare repo on the web server, with a post-receive hook ready to checkout that repo on the site working tree, similar to:

    git --git-dir=/path/to/bare_repo.git --work-tree=/path/to/website/httpdocs checkout -f
    

    You can also pull from the bare repo itself, through a cron job for instance:

    */10 * * * * user /home/usern/git-pull-requests/fetch.sh
    

    But pull or push mean that git is installed on the server.

    If you don't want that, you can use git archive to create an archive (zip or tar), and copy over that for a custom script to uncompress it.

    0 讨论(0)
提交回复
热议问题