Git protocol: Difference between revisions

From wikinotes
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
The simplest way of serving git, unauthenticated and read-only.
The simplest way of serving git, unauthenticated and read-only via the '''git-daemon'''.


{{ WARNING |
{{ WARNING |
Make sure to add the (empty) file git-daemon-export-ok to every repository
Make sure to add the (empty) file git-daemon-export-ok to every repository
that you want to allow git-daemon to access. Otherwise access denied.
that you want to allow git-daemon to access. Otherwise access denied.
}}
{{ NOTE |
If all you need is to export to github or something else, just replace the git history.<br>
See [[git usage]].
}}
}}



Latest revision as of 22:47, 31 July 2022

The simplest way of serving git, unauthenticated and read-only via the git-daemon.


WARNING:

Make sure to add the (empty) file git-daemon-export-ok to every repository that you want to allow git-daemon to access. Otherwise access denied.

NOTE:

If all you need is to export to github or something else, just replace the git history.
See git usage.

Documentation

man git-daemon https://man.archlinux.org/man/extra/git/git-daemon.1.en

Configuration

Enable GitDaemon

FreeBSD

echo "git_daemon_enable=\"YES\"" >> /etc/rc.conf
service git_daemon start

mkdir /usr/local/git
chown git:git /usr/local/git

Archlinux

sudo systemctl enable git-daemon
sudo systemctl start  git-daemon
mkdir /srv/git

Add Repo

Copy/Link repo to git-daemon's configured dir,
and add git-daemon-export-ok to mark it allowed for export.

ln -s /repos/${repo} /usr/local/git/${repo}
touch /usr/local/git/${repo}/git-daemon-export-ok

Pull From Repo

git clone git://${your_server}:9418/usr/local/git/repository.git