Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Reject Force Push Reject all force pushes (git push --force) to this repository

DJM October 30, 2018

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 Force Push

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

 

2 answers

0 votes
Christian Glockner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 31, 2018

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

DJM October 31, 2018

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

0 votes
Rambabu Patina _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 30, 2018

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.

DJM October 31, 2018

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

Rambabu Patina _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2018

Run the commands from the git-config file side like below:

git config --system receive.denyNonFastforwards true
git config --system receive.denyDeletes true

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events