Created
December 26, 2013 21:26
-
-
Save jacquarg/8138908 to your computer and use it in GitHub Desktop.
Create a new git repository. To put in git-shell-commands, to be used with git-shell. Forked from http://planzero.org/blog/2012/10/24/hosting_an_admin-friendly_git_server_with_git-shell
This file contains 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/sh | |
# If no project name is given | |
if [ $# -eq 0 ] | |
then | |
# Display usage and stop | |
echo "Usage: create <project.git>" | |
exit 1 | |
fi | |
# Set the project name, adding .git if necessary | |
project=$(echo "$*" | sed 's/\.git$\|$/.git/i') | |
# Create and initialise the project | |
mkdir "$project" && \ | |
cd "$project" && \ | |
git --bare init |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment