Skip to content

Instantly share code, notes, and snippets.

@tshev
Last active August 29, 2015 14:03
Show Gist options
  • Save tshev/95c8012adb5604d4d4a1 to your computer and use it in GitHub Desktop.
Save tshev/95c8012adb5604d4d4a1 to your computer and use it in GitHub Desktop.
Git repo creator
#!/bin/bash
echo "Enter your path to the repository without name"
read path
cd $path
echo "Enter the reponame"
read reponame
mkdir "$reponame"".git" && cd "$reponame"".git"
git init --bare
cd hooks
echo "Enter the path to --work-tree"
read work
echo "git --work-tree=$work --git-dir=$path/$reponame"".git"" checkout -f" > post-receive
mkdir $work
chmod +x post-receive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment