Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A stupid little script to automatically commit edits to blog posts. More detail here: http://koralatov.com/post/30406748507/git

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .abg-commit-prep.sed
Octocat-spinner-32 .abg-commit.log
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 autoblogit.sh
README.md

autoblogit ("Auto-blog-git")

A stupid little script to automatically commit edits to blog posts, or just about anything else, as a form of shotgun version control.

More detail can be found in the blog post that spawned the script.

Feel free to fork it; it's inelegant and applies no useful description to each commit. I also welcome emails telling me how idiotic and crappy my script is.

How to Use It

  1. cd ~/Documents/Blog
  2. git clone https://github.com/koralatov/autoblogit
  3. cd autoblogit
  4. mv .abg-commit-prep.sed .abg-commit.log .gitignore README.md autoblogit.sh ~/Documents/Blog
  5. cd ~/Documents/Blog
  6. rmdir autoblogit
  7. chmod 700 autoblogit.sh
  8. Set up cron or launchd to run the script periodically.
  9. Pray.

Notes

  • The script assumes your blog posts (or whatever else you want to track) are kept in ~/Documents/Blog. Change that if the files live somewhere else.
  • It's less tidy than it could be, but in the above setup I've moved the script and all of its files into your blog's directory. This is just to keep things simple. In a later revision I might tidy that up.
  • The description is now somewhat useful, though far from ideal. It parses the output of git status using tr (twice), then sed to create an ugly-but-descriptive commit message. It's still far from ideal, but it does at least mean your commit log contains decipherable commit messages.
  • If you're running Max OS X, which has deprecated cron in favour of launchd, I recommend (and use myself) Peter Borg's excellent Lingon app. It makes setting up scheduled launchd events much easier.
  • I accept no responsibility if this causes your system to eat itself.
Something went wrong with that request. Please try again.