Git protocol: Difference between revisions
From wikinotes
(Created page with "The simplest way of serving git, unauthenticated and read-only. {{ WARNING | Make sure to add the (empty) file git-daemon-export-ok to every repository that you want to allow...") |
No edit summary |
||
Line 6: | Line 6: | ||
}} | }} | ||
= | = Documentation = | ||
<blockquote> | <blockquote> | ||
{| class="wikitable" | |||
|- | |||
| <code>man git-daemon</code> || https://man.archlinux.org/man/extra/git/git-daemon.1.en | |||
|- | |||
|} | |||
</blockquote><!-- Documentation --> | |||
= Configuration = | |||
< | <blockquote> | ||
== Enable GitDaemon == | |||
< | <blockquote> | ||
FreeBSD | |||
<syntaxhighlight lang="bash"> | |||
echo "git_daemon_enable=\"YES\"" >> /etc/rc.conf | echo "git_daemon_enable=\"YES\"" >> /etc/rc.conf | ||
service git_daemon start | service git_daemon start | ||
mkdir /usr/local/git | mkdir /usr/local/git | ||
chown git:git /usr/local/git | chown git:git /usr/local/git | ||
</ | </syntaxhighlight> | ||
Archlinux | |||
< | <syntaxhighlight lang="bash"> | ||
sudo systemctl enable git-daemon | |||
sudo systemctl start git-daemon | |||
mkdir /srv/git | |||
</syntaxhighlight> | |||
</blockquote><!-- Enable GitDaemon --> | |||
== Add Repo == | |||
touch /usr/local/git/ | <blockquote> | ||
</ | Copy/Link repo to git-daemon's configured dir,<br> | ||
and add <code>git-daemon-export-ok</code> to mark it allowed for export. | |||
<syntaxhighlight lang="bash"> | |||
ln -s /repos/${repo} /usr/local/git/${repo} | |||
touch /usr/local/git/${repo}/git-daemon-export-ok | |||
</syntaxhighlight> | |||
</blockquote><!-- Add Repo --> | |||
< | == Pull From Repo == | ||
<blockquote> | |||
<syntaxhighlight lang="bash"> | |||
git clone git://${your_server}:9418/usr/local/git/repository.git | |||
</syntaxhighlight> | |||
git clone git:// | </blockquote><!-- Pull From Repo --> | ||
</ | </blockquote><!-- Configuration --> | ||
</blockquote><!-- |
Revision as of 15:45, 31 July 2022
The simplest way of serving git, unauthenticated and read-only.
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.
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/gitArchlinux
sudo systemctl enable git-daemon sudo systemctl start git-daemon mkdir /srv/gitAdd Repo
Copy/Link repo to git-daemon's configured dir,
and addgit-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-okPull From Repo
git clone git://${your_server}:9418/usr/local/git/repository.git