Last active
March 24, 2017 12:44
-
-
Save jonbesga/15e3ee11e5776fa947285f6e6b4240a7 to your computer and use it in GitHub Desktop.
create_repo_and_first_commit
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
USER=jabesga | |
REPO_NAME=$(basename "$PWD") | |
DATA="{\"name\":\"${REPO_NAME}\"}" | |
echo "Creating repository ${REPO_NAME}" | |
curl --fail --silent -u $USER --data $DATA https://api.github.com/user/repos > /dev/null | |
echo "Initializing local git repository ${REPO_NAME}" | |
git init | |
echo "Adding remote" | |
git remote add origin [email protected]:$USER/$REPO_NAME.git | |
echo "First commit and push" | |
git add -A | |
git commit -m "first commit" | |
git push -u origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment