Skip to content

Instantly share code, notes, and snippets.

@shawndumas
Created September 9, 2011 18:13
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 shawndumas/1206925 to your computer and use it in GitHub Desktop.
Save shawndumas/1206925 to your computer and use it in GitHub Desktop.
Git init the current directory and create a new remote bare repository for it (on g:\ in this case)
#!/bin/sh
CURRENT_DIR=${PWD##*/}
git init
git add .
git commit -m "first commit"
pushd $1
mkdir "$CURRENT_DIR.git"
cd "$CURRENT_DIR.git"
git init --bare
popd
git remote add origin "$1$CURRENT_DIR.git"
git push origin master
git branch --set-upstream master origin/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment