You searched for articles tagged with ThisBlog.

Using Git to Rollback Bad Deployments Permalink

Git, ThisBlog, Apache Added more than a year ago and last edited less than a year ago

Git just keeps rocking my world.

OK, here is how I deploy my blog and here is how git saved me last night when the deployment went bad:

I git-pull into a webroot directory (well, the directory that is setup to serve my python) from my main git repo (which is also hosted on the same machine.)

When I updated the blog software last night I did a git-pull, restarted apache and saw the error (yes I should've caught it in dev, shoulda-coulda-woulda but-but-but.)

So, error noted. What do I do to rollback to the last working version?

$ git log

... and I copy the SHA hex-string of the last working commit. Then we rollback with:

$ git checkout <copied_hex_string>

... and restart apache. Ta-da! Now the blog is still up while I do the bug fix.

OK so what happens when I've commited the fix and I want to make the blog update?

$ git pull

... puts all the new changes in the git repo but doesn't fast-forward it to the HEAD of master automatically. Why? Because you aren't in master anymore - you've checked out a previous commit. So all you need to do now is:

$ git checkout master

... restart apache and you're set.

EDIT: Here is some info to rollback to the previous commit in a more general way:

$ git checkout HEAD~1
...  # you are now at the previous version
$ git checkout master
... # you are now back to the latest version



Blog Update Permalink

Django, ThisBlog Added more than a year ago

Notice the new Recent Entries section on the right.




Rain Serpent Permalink

Cool, ThisBlog Added more than a year ago and last edited less than a year ago

The new logo at the top of this page is inspired by a picture of the rain serpent, as shown in the book American Indian Design & Decoration.

I love the plates in this book - the art is beautiful.

Rain Serpent




(Nothing Older) ... (Nothing Newer)

Colophon

Django Python 960.gs Git Vim NetBSD Nginx

The Author

The author is a software engineer living in Australia. He sux at guitar, loves camping, doesn't like cake, does like coffee and is a lazy home brewer.

Meta

Help
Latest entries

*BSD Agile Apache Apple Athletics Beer Best-Practice Censorship Comedy Cool Crosswords Deployment Django English Exim Firefox Git Hardcore Health Interface irssi Javascript Jira Languages Linux Makefile Markdown Mathematics Mobile Broadband MySQL NetBSD nginx Nokia OSX Perl Photo Privacy Python Rant Requirements rsync Ruby Shell Slackware SQL SQLite SSH Standards Subversion Testing ThisBlog Vim VMWare (Fusion) VPN WDTEM X Yum zsh

Recent Entries

Perldoc Output
Yum
Possum
Git's Index
Jira Project Keys
The Coffee Shop
Git GUI
It is more important...
Questioning Unix (and Other) File Times
The Frog King Photo
Rain Cloud Photo
rsync
Timezone
utf8 in your Perl
Theatre Ceiling Photo
Some problems are so complex...
Colours in your PAGER
zsh vared
zsh magic-equals and double-star
Funny Tweets

Links

ChoppingBoard, Project365, RageQuit

♥ Actors/Artists/Characters