0

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.

1
  • Don't manually modify Git configuration files. Use git config. Commented May 3, 2018 at 12:55

2 Answers 2

1

Not [core]:

[receive]
denyNonFastForwards = true

To avoid such troubles edit config with command line:

git config receive.denyNonFastForwards true
Sign up to request clarification or add additional context in comments.

2 Comments

do we need any restart after this changes done ? i have added that , but still force push is working . followed the git config command
Restart? Probably? The config command must be given at the server either in a repository (in every repo you want to protect) or globally: git config --global receive.denyNonFastForwards true
1

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.

1 Comment

mine is 1.51 :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.