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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucker prehook configurations

I am using Windows system.

I am configuring Bit-bucket precommit hooks, Use case is "I want to reject all the commits that doesn't have a valid JIRA key"

I have tried different plugins like "Yet another commit checker" "Control Freak" and some other free plugins from market place.

I have also tried to do it via script present in .git folder through gitbash, However, I want to do it on server level.

Could you please help me with how to add this restriction via any free plugins or script?

1 answer

1 accepted

0 votes
Answer accepted

 

I'm one of the Control Freak maintainers.  I recommend setting it up like this (click on "Administration" --> "Control Freak"):

jira-policy.png

That setup will force all commits on the protected branches (master, production, release/*) to have Jira tickets in their commit messages.

Thanks for your response @Sylvie Davies _bit-booster_com_ 

I took reference of your another answer present at https://community.atlassian.com/t5/Bitbucket-questions/Require-issue-keys-in-commit-messages/qaq-p/1171253 and tried configuring with Control freak.

However, the problem that i am facing with control freak is that i can pass jira issue key in square bracket only and it is not accepting any other commit message other than [Jira_issue_key]

Let's take an example, If my JIRA issue key is AP-242, please find following actions

Accepted commit: commit -m [AP-242]

All other commits are getting rejected other than above, like I am not  able to provide any commit message. Could you please provide me how exactly you are committing to bitbucket repository with commit message.

Actuallly i am not getting any error at commit, but i am facing error while pushing code "Control freak rejected your push"

I have tried following, However, Control freak is rejecting

commit -m "AP-242 Change in add button"

commit AP-242 "Change in add button"

I have tried almost all possible ways to give commit message, However Control freak is rejecting everything, If you could let me me know how you are adding message to your commit  that will be really helpful.

I am using Git-bash to commit code.

Appreciate your help!

BAZ

Thanks for your response @Sylvie Davies _bit-booster_com_ 

I took reference to your other answer present at https://community.atlassian.com/t5/Bitbucket-questions/Require-issue-keys-in-commit-messages/qaq-p/1171253 and tried configuring with Control freak.

However, the problem that I am facing with control freak is that I can pass Jira issue key in square bracket only and it is not accepting any other commit message other than [Jira_issue_key]

Let's take an example, If my JIRA issue key is AP-242, please find following actions

Accepted commit: commit -m [AP-242]

All other commits are getting rejected other than above, like I am not  able to provide any commit message. Could you please provide me how exactly you are committing to bitbucket repository with commit message.

Actuallly i am not getting any error at commit, but I am facing error while pushing code "Control freak rejected your push"

I have tried following, However, Control freak is rejecting

commit -m "AP-242 Change in add button"

commit AP-242 "Change in add button"

I have tried almost all possible ways to give commit message, However Control freak is rejecting everything, If you could let me me know how you are adding message to your commit  that will be really helpful.

I am using Git-bash to commit code.

Thanks in Advance!

BAZ

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,804 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you