Skip to content

Instantly share code, notes, and snippets.

@glombard
Created August 3, 2014 18:18
Show Gist options
  • Save glombard/9f7ed306b2d4791a30cf to your computer and use it in GitHub Desktop.
Save glombard/9f7ed306b2d4791a30cf to your computer and use it in GitHub Desktop.
Create a BitBucket Git repo for my current working directory
function mkrepo () {
BBUSER=user
BBPASS=password
BBLOGIN=$BBUSER:$BBPASS
DIR=${PWD##*/}
echo "Making BitBucket repo '$DIR' ..."
git init
curl -u $BBLOGIN -X POST https://api.bitbucket.org/1.0/repositories/ -d "name=$DIR&is_private=1" -v
git remote add origin https://$BBUSER@bitbucket.org/$BBUSER/$DIR.git
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment