Skip to content

Instantly share code, notes, and snippets.

@dronir
Created June 13, 2015 09:33
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 dronir/81ef5bef823123fd66ce to your computer and use it in GitHub Desktop.
Save dronir/81ef5bef823123fd66ce to your computer and use it in GitHub Desktop.
function make_remote
switch (count $argv)
case 0
echo "Not enough arguments."
case 1
set REPOPATH "git-repos/$argv[1].git"
_make_remote $REPOPATH
case 2
set REPOPATH "git-repos/$argv[1].git"
_make_remote $REPOPATH
git remote add $argv[2] lakka:$REPOPATH
case '*'
echo "Too many arguments."
end
end
function _make_remote
ssh lakka "mkdir $argv[1] && cd $argv[1] && git init --bare"
echo "Created bare git repository lakka:$argv[1]"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment