Created
May 3, 2024 11:41
-
-
Save arf20/e3cc67b5de04331d9e8598163737b847 to your computer and use it in GitHub Desktop.
Create bare git repo for git server with nginx and git daemon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -eq 0 ]] ; then | |
echo "usage: $0 <repo path>" | |
exit 0 | |
fi | |
cd /srv/git | |
mkdir $1 | |
cd $1 | |
git init . --bare --shared | |
git update-server-info | |
cat <<EOF >> config | |
[http] | |
receivepack = true | |
EOF | |
git config --bool core.bare true | |
touch git-daemon-export-ok | |
chown -R www-data:www-data . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment