I want to Deny or Prevent history rewrite on a local git repository. I know I can achieve this in the remote repository using:
git config --system receive.denyNonFastforwards true
git config --system receive.denyDeletes true
But it only works on git server (not local repo).
How can I disable amend and rebase on git local repo? Something like:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
denyRebase = true <--
denyAmend = true <---
[receive]
denyNonFastforwards = true
denyDeletes = true
Updade: My intentions
We develop the app that kinda like plagiarism prevention. It will record all file history at certain interval and other info during work assignments. So we can analyze with some formula on that history then decide suspected student that plagiarized. .git repo will be zipped along with assignment and send to us. Now we are re-searching the best approach to prevent any ability on history rewriting. Some of our candidate: 1. Pushing the local commit to our remote repo at certain interval 2: fork git and drop those feature.
Thank you