Skip to content

Instantly share code, notes, and snippets.

@transistor1
Last active August 29, 2015 14:03
Show Gist options
  • Save transistor1/d75650c5540e5eafed9c to your computer and use it in GitHub Desktop.
Save transistor1/d75650c5540e5eafed9c to your computer and use it in GitHub Desktop.
Push a folder to a plugin repo
#!/bin/bash
USER=git-username
PREFIX=shellista
REPO=$PREFIX-$1
echo "Enter password:"
read -s PASSWORD
curl -u "$USER:$PASSWORD" https://api.github.com/user/repos -d "{\"name\":\"$REPO\"}"
git init .
git add "$1"
git commit -m "Initial commit; copy of $1 repo in $PREFIX"
git push https://$USER:$PASSWORD@github.com/$USER/$REPO.git master
rm -rf .git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment