As we consider moving from SVN to git at work, a coworker has raised the concern that a malicious or accident-prone developer could use git rebase to delete remote history from our shared repo.
Edit: As pointed out in the answers, entire branches could also be deleted from the remote repo with git push origin :branch-name.
Is this a realistic problem? If so, what approach can we take to prevent it?
I tend to agree with your coworker that there is a problem here because:
Have you considered the
receive.denyNonFastForwardsandreceive.denyDeletesconfig parameters? AFAICT these are available in Git 1.6 onwards.From Pro Git:
As the author mentions, this rule can also be enforced via a receive hook (which is described later in Pro Git).
These techniques should protect against accidental (or malicious) lost history in your shared repo.