How can I enable anonymous read access (pull) but authenticated write access (push) to a git repository over http?

前端 未结 2 1914
慢半拍i
慢半拍i 2021-01-05 09:33

I want to have git repository available via \"smart\" HTTP to which only I can push, but which anybody (or anybody with account) can clone / fetch from.

相关标签:
2条回答
  • 2021-01-05 10:01

    You have to update your repo .git/config file with the following value:

    [http]
        receivepack = true
    
    0 讨论(0)
  • 2021-01-05 10:21

    One not so complex alternative is to use gitolite in addition of your Apache-git setup.
    You can plug gitolite to Apache easily enough (no ssh config required).

    See as an example: httpd.conf, combined with this local gitolite installation script.

    You can then easily declare Apache logins for Write access, and @all for read access.

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