Git: Allow amending commits without erasing the history

335 views Asked by At

Is there an option in Git to allow amending commits in a central repository (e.g. to change the description, committer name or his/her e-mail address), but not allowing to erase the entire history.

As I understand it, by default both are allowed (receive.denynonfastforwards = false).

1

There are 1 answers

0
o11c On

There is fundamentally no way for git to tell the difference between such changes to commits.

You can, as a human, check that the commits have the same tree (i.e. git rev-parse HEAD^{tree}), and I am vaguely aware of git-notes but have never used it.