jquery

gist JS

Wednesday, April 08, 2009

git panic

Not sure about that rebase, merge or pull? Worried that listening to Kenny Loggins while you work might hose the repo? Don't let this happen to you.

Introducing Git Panic, your 1-step disaster prevention toolkit. If you wouldn't walk around a hallway in Doom without auto-saving, why would you use version control without the same measure of paranoid caution? Remember, git is one of the most dangerous tools on your system. While it is powerful, using git means that with one simple command you could easily trash the remote repository and simultaneously downgrade from OS X to Windows 98.

git config --global alias.panic '!tar cvf ../git_panic.tar *'

Now whenever you get nervous, just push the 'git panic' button and breath deeply, you can always restore from a tarball. Good ole tar.

Extra points if you hook it up to a red button on your keyboard.

-mav

No comments: