Using Git in your code demos and presentations

Saw Dan Draper at the Adelaide Rubyist meetup last night, for a presentation on Grape.

During the presentation, he was editing the code to make changes or comment out chunks that he was going to demo later.

It occurred to me (and I’m putting it up here to remind myself later) that this could be done much better with Git.

If you are working on a presentation, when you have got the demos you want working you can make a tagged commit:

git commit -m “First demo, barebones / compilable / doesn’t do anything”

git tag example1

<edit / test cycles>

git commit -m “Second demo, widget API call works”

git tag example2

You can now move back and forth during the demo, no editing required to make sure it all behaves (or at least less chance of things going badly…)

Leave a Reply

Your email address will not be published. Required fields are marked *