Created
October 28, 2011 05:00
-
-
Save waffle2k/1321662 to your computer and use it in GitHub Desktop.
Simple script for creating bare git projects.
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 | |
# This will create a new repository, with a sample README, and clone it | |
# to a default location | |
PROJNAME=$1 | |
if [ -d /home/git/tmp/$PROJNAME ]; then | |
echo "Project by that name already exists" | |
exit 1 | |
fi | |
# Create an empty project | |
mkdir -p /home/git/tmp/$PROJNAME | |
cd /home/git/tmp/$PROJNAME | |
git init | |
touch README | |
git add README | |
git commit -m "initial project" | |
# Clone it | |
git clone --bare /home/git/tmp/$PROJNAME /home/git/$PROJNAME.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment