Hi,
we are using server 5.7.1 BitBucket and we want user should not do forcefully push to master branch to prevent this we enable this hook
Reject all force pushes (git push --force) to this repository
but what we are seeing even though if we enable this we are still able to push the changes forcefully to master
can you please let us know what we are missing
Thanks
DJM
Hi,
A "force push" in the sense of "reject force push" is a push that would otherwise be rejected if you didn't force it. In other words, a push that would work without any conflicts doesn't become a force push just because you add --force.
Cheers,
Christian
Premier Support Engineer
Atlassian
Hi,
thanks for the reply.
can i get more details regarding will be thankful if you can point me where the document or this.Iam trying hard to find this details.
i thought this hooks was not to override the history on master forcefully if anyone try this could be my wrong understanding but will be good if you can please share more details.
Regards
DJM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @DJM,
Probably you can set up the configuration variables:
receive.denyNonFastForwards
receive.denyDeletes
It will prevent any 'forced' pushes from working across all branches.
For more details, please have a look at Allow users to set the flag denyNonFastForwards on Git repositories .
Thanks,
Ram.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ram,
where are this setting do i need to this on bitbucket server.
or the branch mangement side try to find out where to this change.
is it gitconfig file or what can you let me known
Thanks
DJM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Run the commands from the git-config file side like below:
git config --system receive.denyNonFastforwards true
git config --system receive.denyDeletes true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.