new-repo.sh (610B)
1 #!/bin/sh 2 3 # This shell script creates a new git repo to make things easier. 4 5 echo "What is the name of the new repository?" 6 read NAME 7 mkdir /usr/local/www/git/${NAME} 8 cd /usr/local/www/git/${NAME} 9 git init --bare 10 mv ./hooks/post-update.sample ./hooks/post-update 11 echo "exec /home/git/run.sh" > ./hooks/post-update 12 vim description 13 14 # Reload git so repo is available 15 # The below are no longer necessary as there is a git_daemon service now 16 #killall git-daemon 17 #git daemon --reuseaddr --base-path=/usr/local/www/git --export-all --enable=receive-pack /usr/local/www/git/* & 18 echo "Restart the git_daemon service"