Created
September 30, 2009 15:35
-
-
Save peterc/198184 to your computer and use it in GitHub Desktop.
Create and sync a new git repository on Dreamhost
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
# Create a new git repository on Dreamhost | |
# Function tweaked from that found at http://craigjolicoeur.com/blog/hosting-git-repositories-on-dreamhost | |
# | |
# Just add the code below to your .bashrc. | |
# Usage: | |
# newgit some-repo.git | |
# | |
# Then locally: | |
# | |
# git push --all ssh://$MACHINE/home/$USER/git/my-new-repos.git | |
# git remote add origin ssh://$MACHINE/home/$USER/git/my-new-repos.git | |
# git config branch.master.remote origin | |
# git config branch.master.merge refs/heads/master | |
# git fetch | |
# git merge master | |
newgit() | |
{ | |
if [ -z $1 ]; then | |
echo "usage: $FUNCNAME project-name.git" | |
else | |
gitdir="/home/$USER/git/$1" | |
mkdir $gitdir | |
pushd $gitdir | |
git --bare init | |
git --bare update-server-info | |
chmod a+x hooks/post-update | |
touch git-daemon-export-ok | |
popd | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment