Skip to content

Instantly share code, notes, and snippets.

@jbarrett
Last active December 16, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbarrett/5501284 to your computer and use it in GitHub Desktop.
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.
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}"
}
@jbarrett
Copy link
Author

jbarrett commented May 2, 2013

Usage:

$ newrepo testing.git
Password:
Initialized empty Git repository in /home/git/testing.git/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment