-
-
Save sunny/7533 to your computer and use it in GitHub Desktop.
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
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" | |
[ $? != 0 ] && echo "git repository creation failed" && return 1 | |
git remote add origin bearnaise.net:~simon/repositories/$name | |
git push origin master | |
else | |
echo "no a git repository, asshole" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment