3 ms·
The crucial criticism: The fundamental promise of any version control system is this: “Once you put your precious source code in here, it’s safe. You can make
by Animats 10y ago
The crucial criticism:
The fundamental promise of any version control system is this: “Once you put your precious source code in here, it’s safe. You can make any changes you like, and you can always get it back”. Git breaks this promise. Several ways a committer can irrevocably destroy the contents of a repository:
git add . / … / git push -f origin master
git push origin +master
git rebase -i <some commit that has already been
pushed and worked from> / git push
That should not be possible.
Mandatory XKCD: [1]
[1] https://xkcd.com/1597/ https://xkcd.com/1597/
- jjoonathan 10y agoA previous criticism was that you had to know about a set of things including the reflog in order to use git. The reflog is one of several ways to undo the "irrevocable destruction" above. Complaining about both issues feels like double-dipping :) Also, I suspect that many of the "hosted git" implementations out there prevent this from happening by default. I know that both of the ones I use in my day job (gitlab and bitbucket) do, but I'm not 100% certain it's a default as opposed to something our ops guys did. In any case, far from impossible. EDIT: see boaardwalk's post. Also, svn won't protect you from `rm -rf /` on the server, while git will, which is pretty cool.
- boardwaalk 10y agogit config receive.denyNonFastForwards true Should it be the default? Probably, but it's trivial to fix.