Note: If you want to use your personal Twitter account to post commits, go to Step 2
- Create a new Twitter account for your commit messages. Example
- Go to http://dev.twitter.com and Sign In with your Twitter account you are posting commit messages to.
- Hover over your username in the top-right corner after signing in and select "My Applications"
- Create a new application
- The name, description, and site can all be whatever you want, but leave Callback URL empty
- Under "Application Settings" click "modify app permissions" next to "Access level"
- Select "Read and Write" and then click "Update Settings"
- On the tabs at the top, go to "API Keys"
- Scroll to the bottom and under "Your Access Token click "Create my access token"
- Copy down into a text document the "API Key" and "API Secret" under "Application Settings" as well as "Access Token" and "Access Token Secret" under the genereted "Your Access Token" - you need these later
- You may have to wait a few moments and refresh in order to see your access token
- You can close Twitter Developer now
- Download oauth_sign and http_post, save them somewhere that you can easily find them
- Open your favorite Terminal application and cd to the directory of the uncompressed oauth_sign zip (e.g.
cd /path/to/oauth_sign/
) - Run
sudo make
thensudo make install
from inside the oauth_sign directory - Now cd into the directory of the uncompressed http_post zip
- Run
sudo make SSL_DEFS="-DUSE_SSL" SSL_LIBS="-lssl -lcrypto"
thensudo make install
- Open a new Terminal window and make sure they are there by typing
oauth_sign
andhttp_post
and it doesn't saycommand not found
- You can delete the left over files now
- Save the post-commit file from this gist and edit the file with your personal API Keys that you put in the text document earlier
- Copy post-commit into your local git repository in .git/hooks/post-commit
- Run chmod a+x on the post-commit in order to make it executable
- Now it should send a tweet every time you make a commit message from the repo you added it to
- Create a .git_template/hooks/ folder in your home directory
mkdir ~/.git_template
mkdir ~/.git_template/hooks/
- Run
git config --global init.templatedir '~/.git_template'
- Copy all the files from your current git repo's hooks folder (the one you put post-commit in) into the new hooks folder
- e.g.
cp -R /my/git/repo/.git/hooks/ ~/.git_template/hooks/
- Done! Every time you create a new repo on your machine, the post-commit file should be there
Looks like the url for creating / managing apps has changed?
The
dev
address appears to be pimping their new suite of SDKs.