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

Is it possible to edit the commit message after a push to repo

Commit messages in our organisation are supposed to include the Jira Ref. But some dont. This means that the links we have between Jira stories and Bitbucket commits arent made. Is it possible to amend these after they have been committed and pushed to the repository event to get the links in place?

1 answer

0 votes

Generally speaking, it's discouraged to alter Git commits that are already published (pushed to a repo from which your team mates may have pulled those in the meanwhile).

The correct workflow is to require the issue key before the commit is created!

That means that if you try commit without entering a valid Jira issue key in the commit message, your commit should be rejected.

This supports this workflow:  

Yep That is the correct course of action (Require a correct format on commit messges) and wouldn't it be wonderful if that was in place in our organisation? 

Sadly it isnt and so We are where we are; with a shed load of commits that dont link back to the Jira Stories.

Reprimanding the Developers - telling them that they are very naughty doesnt fix the issue.

Sorry this doesnt fix the problem.

We need to change what has already happened.

Like loridk likes this

Some more ideas:

  1. Use Git notes (which AFAIK can be safely altered after creation) instead of the commit message to establish the link. 
  2. Use the Git Integration app. It allows manually linking commits to Jira issues. (The link doesn't become part of the commit message.)

Thank you for your assistance so far. If I use option 1 above, will the Commit then automatically show up in this (Visible on the Jira Story) :
Example Jira Commit fragment.jpg

I am not sure. You should try. 

I have and it didnt :( so the Links remain broken - Thanks anyway. There appears no way to fix this.

(Other than by using a Re-Base)

Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,717 views 10 16
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