You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi,
Since I made a mistake and I take the wrong 'JIRA issue' in my Pull Request creation, I need to remove the current association to replace by another JIRA issue. It seems there's is no possibility to de-associate any JIRA issue when you use its name in commit or PR message when working with Bitbucket. Once the JIRA is associated, all JIRA developement panel can't be updated to new one and the PR detail view in Bitbucket Server can't also modify this association.
Is someone has a solution for that? (without deleting all my PR )
Thank you.
Community moderators have prevented the ability to post new answers.
tl;dr version: rewrite the history on your "personal" branch to fix up the bad commit message, and then "push -f" that version of the branch (force push). The PR will automatically pick up the rewritten branch.
---
Here's one way to do that:
I would run an interactive rebase on your personal branch to rewrite the bad commit message, and then force-push the updated branch to your Bitbucket Server. Your "branch permissions" config for the repo would need to allow history rewriting on the "personal" branch for this to work. Here are the exact commands I would run from git cli:
# WARNING: "git branch -d" deletes local "personal" branch. # Make sure there's no uncommitted or unpushed work you don't mind losing! git branch -d personal git fetch -p git checkout personal git rebase -i HEAD~4 (to edit commit messages of last 4 commits)
This fires up an editor for the "interactive rebase". Mark the commit that needs a new message with "reword" and leave all the others with "pick" (commits marked with "pick" are left alone). Don't bother trying to edit commit messages in the editor, because it will have no effect during this phase of the process, and be careful not to rearrange the order of commits. Save the rebase instructions. Close the editor. The rebase should proceed automatically the moment the editor is closed, which should cause a new editor to be launched for the commit message editing.
Assuming the rebase fired up yet another editor window, now is the time to edit the bad commit message.
Save your edited commit message. Close the editor. The rebase should then finish up.
Type "git log" to see if everything looks good. If it does, type:
git push -f origin HEAD:personal
Your PR should be all good now!
Note: if your git's "push config" is set to "simple," then you can just type "git push -f" at this last step. But I cannot in good faith recommend that unless YOUR ARE SURE your "push config" is set to "simple" because the result could be catastrophic if your "push config" is set to a different value.
p.s. I'm the author of a Marketplace add-on: Bit-Booster Commit Graph And More.
Thanks for your complete answer
I understand now better how Bitbucket Server works now.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The FROM branch is personal branch TO a Master branch.
I have 6 commits on it, the wrong JIRA was associated on the 3rd commit. Other commits are correct.
Is this enough answer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you include some specific details about your PR? What is the "from" branch, what is the "to" branch, how many commits are on the "from" branch that aren't on the "to" branch (e.g., git fetch; git log origin/to..origin/from)? And finally, how many commits reference the wrong JIRA issue, what branch are they on, and do the occur on the tip or before the tip of that branch?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.