Skip to content

Instantly share code, notes, and snippets.

@moccos
Created April 16, 2015 09:46
Show Gist options
  • Save moccos/a7a8c9085b032f55aed9 to your computer and use it in GitHub Desktop.
Save moccos/a7a8c9085b032f55aed9 to your computer and use it in GitHub Desktop.
Initialize a git repository at server.
#!/bin/sh
repo_name=$1
if [ $repo_name = "" ]; then
echo "Specify repo name."
exit -1
fi
dir_name=${repo_name}.git
mkdir $dir_name
cd $dir_name
git --bare init --share
cd ..
chmod -R 777 $dir_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment