Created
August 3, 2014 18:18
-
-
Save glombard/9f7ed306b2d4791a30cf to your computer and use it in GitHub Desktop.
Create a BitBucket Git repo for my current working directory
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 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