git/git-reference

stash and revert

Closed this issue · 8 comments

please add git stash and git revert

Any ideas on where git revert would fall under on the topics?

Doesn't feel like a basic snapshot type of lesson to learn as it can get messy rather quickly.

And if we based things sort of along the lines of Git SCM, it's not even listed there.

Would have to think about where it fits, but thinking about how to structure it as a "short lesson," what do you think about this (have used this in the classroom):

  • Most coding is forward moving.
  • Git allows craftsmen and craftswomen to think about making the history beautiful, not just the "end state."
  • When you create more handsome intermediate states, it is easier to roll back.
  • Git revert surgically inverts an old (bad) commit with a new one at the end of the timeline. This is like a banking transaction where you write a new ledger entry that apologizes for the mistake, not erasing the old incorrect ledger entry.

Squashing commits also play into making a beautiful history. You can have a dozen incremental commits all neatly rolled into one umbrella.

Liking the bank ledger analogy. If people forget what ledgers are you could also reference credit card chargebacks.

Having thought about this, it almost a warrants a separate section on the left nav. "Shaping history"

?

Agreed. Though, thought that's where you were heading in anyway when thinking about making a lesson of it.

@randomecho Ah. The lesson isn't for the this, but rather for a slide deck for our training services via http://training.github.com (but will be open source). Was just noting what was working for me in the classroom.

No sharing