Skip to content

Instantly share code, notes, and snippets.

@binfeng
Created June 11, 2015 07:45
Show Gist options
  • Save binfeng/c9806b854de3a4ddbb3a to your computer and use it in GitHub Desktop.
Save binfeng/c9806b854de3a4ddbb3a to your computer and use it in GitHub Desktop.
Auto commit and push to Github (experimental)
#!/bin/bash
#eval "$(ssh-agent -s)"
#SERVICE='ssh-agent'
#if ps ax | grep -v grep | grep $SERVICE > /dev/null
#then
# :
# #echo "$SERVICE service running, everything is fine"
#else
# echo "$SERVICE is not running"
# eval "$(ssh-agent -s)"
#fi
#ssh-agent ssh-add ~/.ssh/github_id_rsa
cd {your git directory}
/usr/bin/git remote rm origin
#/usr/bin/git remote add origin '[email protected]:{username}/{repo}.git'
/usr/bin/git remote add origin 'https://{token}@github.com/{username}/{repo}.git'
#/usr/bin/git rm -rf --cached .
/usr/bin/git add .
/usr/bin/git commit -am "."
/usr/bin/git push --set-upstream origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment