soundararajan.c
soundararajan.c

Reputation: 2567

Block git force push for all branches

I m using SCM-Manager(GIT).

I wish to block the force push option in a repository named "git_playground" for all branches in the remote

I'm not sure where the below config to set in the git server

receive.denyNonFastForwards true

I have tried to set the above confi in config file of the repository under [core] as

receive.denyNonFastForwards =  true

After this i cannot be able to clone that repository . So revoked it.

Upvotes: 0

Views: 903

Answers (2)

sdorra
sdorra

Reputation: 2392

You could also use the SCM-Manager configuration option Disallow Non Fast-Forward (available since version 1.55) at Config->Repository Types->Git. If this option is enabled SCM-Manager will block every force push. But this option is global and affects every repository on the SCM-Manager instance.

Upvotes: 1

phd
phd

Reputation: 94676

Not [core]:

[receive]
denyNonFastForwards = true

To avoid such troubles edit config with command line:

git config receive.denyNonFastForwards true

Upvotes: 1

Related Questions