Unable to push the changes after running bfg repo cleaner

Kiran Kumar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 18, 2024

 

Unable to push the changes after running bfg repo cleaner.

Getting the below error: 

 

! [remote rejected]       19580_BugFix -> 19580_BugFix (pre-receive hook declined)

2 answers

1 vote
Mahesh Shinde
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.
December 18, 2024

Hi @Kiran Kumar

The pre-receive-hook declined error is usually returned when you have some branch restrictions set up in your repository, and the commit you are trying to push does not meet the requirements of that branch restriction.

You can check the pre-recieve hook configuration policy is enabled in repositoty settings which can block this push.

Regards,

Mahesh Shinde

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 20, 2024

Hi @Kiran Kumar and welcome to the community!

I just wanted to add clarity to Mahesh's reply:

The branch restrictions that may cause this error are:

Allow rewriting branch history

If rewriting branch history is disabled, you won't be able to push your changes. What BFG does is rewrite history in the repo, so rewriting branch history needs to be enabled (even temporarily) in order to push changes with BFG.

Only specific people or groups have write access

You may have restricted write access to the branch only to specific users, and your user may not be included in that list. If this is the case, you will need to add your user to the list of users with write access to the branch.

Branch restrictions can be found from Repository settings > Branch restrictions.

Please feel free to let us know if that helps with resolving your issue or if you need further assistance.

If you would like us to run a git gc on your repo after you push your changes to remove any unreferenced commits and objects, please feel free to let me know.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events