Skip to content

Instantly share code, notes, and snippets.

@younata
Created November 14, 2013 03:41
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 younata/7460963 to your computer and use it in GitHub Desktop.
Save younata/7460963 to your computer and use it in GitHub Desktop.
bash script to create git repo on server using ssh...
#!/usr/bin/env bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <reponame>"
else
echo "creating $1.git"
mkdir $1.git
cd $1.git
dir=$(pwd)/$1.git
git --bare init
cd ../
echo "now, set the remote to use ssh://`whoami`@`hostname`:<ssh port>$dir"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment