Last active
December 16, 2015 21:39
-
-
Save jbarrett/5501284 to your computer and use it in GitHub Desktop.
First pass at .bash_profile function for quick creation of new git projects. Requires sudoer rights.
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
newrepo() { | |
repo=$1 | |
if [ -z $repo ] ; then | |
echo "No repository name specified" | |
return 1 | |
fi | |
[[ ! $repo =~ \.git$ ]] && repo="${repo}.git" | |
sudo -u git git init --bare "/home/git/${repo}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
$ newrepo testing.git
Password:
Initialized empty Git repository in /home/git/testing.git/