Created
April 3, 2017 03:40
-
-
Save slavama/fae3990a26221e8b2fc03c21a9fa2cf8 to your computer and use it in GitHub Desktop.
Create remote private repository
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
#!/bin/bash | |
PROJECT=$1 | |
REPO_USER=myusername | |
REPO_API_URL=https://api.bitbucket.org/1.0/repositories/ | |
PROJECTS_DIR=/home/username/projects | |
APP_DIR="$PROJECTS_DIR/$PROJECT" | |
curl --user $REPO_USER $REPO_API_URL --data name=$PROJECT --data is_private='true' --data scm='git' | |
if [ ! -d $APP_DIR ]; then | |
mkdir $APP_DIR | |
fi | |
cd $APP_DIR | |
git init | |
git remote add origin "http://bitbucket.org/$REPO_USER/$PROJECT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment