Hacker News new | ask | show | jobs
by tekkub 5801 days ago
I find the "too easy to break the repo" argument really quite odd. While I understand why users think this is true, it's actually very far from the case. The git repo is very stable, has built in error checking, and is extremely stubborn about removing data. The working copy on the other hand, is very easy to jack up if you're not sure what your commands are doing.

The best thing you can teach someone just learning git is to commit very frequently. If your files are committed, you can undo most any error. But if you've got a dirty working copy, you could lose it if you do something drastic. As an added bonus, this also teaches the user to branch often, and eventually they'll find the majick of `git rebase --interactive`

1 comments

What does this do?

git branch origin :featureBranch?

disclaimer; don't experiment in a data critical repo

I assume you mean `git push origin :featureBranch`? Deletes a branch pointer on a remote repo. No data is lost, it just takes a little effort to dig it back up if you don't know what SHA the branch was at.
Yeah, that's the one I meant, I still find it extremely counterintuitive, one character is the difference between push my current changes to origin and delete the branch on the remote side.