Skip to content

Instantly share code, notes, and snippets.

@sr
Created August 27, 2008 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save sr/7531 to your computer and use it in GitHub Desktop.
Save sr/7531 to your computer and use it in GitHub Desktop.
function is-git? {
git status &> /dev/null
[ $? != 128 ]
}
function git-init-remote {
name=$(basename $PWD).git
path=~/repositories/$name
if is-git?; then
ssh bearnaise.net -t "mkdir $path && cd $path && git --bare init" ||
(echo "git repository creation failed" >&2 && return 1)
git remote add origin bearnaise.net:~$USER/repositories/$name
git push bearnaise master
else
echo "Not a git repository, asshole." >&2 && return 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment