Skip to content

Instantly share code, notes, and snippets.

@codearmorygists
Created September 19, 2012 23:20
Show Gist options
  • Save codearmorygists/3752986 to your computer and use it in GitHub Desktop.
Save codearmorygists/3752986 to your computer and use it in GitHub Desktop.
Gitdrop: add file to Github Page, push to web, and put URL into clipboard
#!/bin/bash
DIR="/Path/to/gh-pages/repo" # Path to gh-pages repo
URL="http://website.com" # Domain and path to where the GitHub Page lives on the web
BASE=`basename $1`
cp $1 $DIR
cd $DIR
git add $BASE
git commit -m "$BASE added"
git push origin gh-pages
echo "$URL/$BASE" | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment