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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello, how can i create a branch from an old commit?
thanks
Unfortunately there is no way in the UI to create a branch from an old commit.
You can create a branch from a commit in git using your terminal and the command:
git branch <branchname> <commitHash>
Unfortunately there is no way in the UI to create a branch from an old commit.
You can create a branch from a commit in git using your terminal and the command:
git branch <branchname> <commitHash>
There is a way. It's a little awkward, but it works.
1. Click on the commit in the web UI.
2. Click on the "[+]" button next to the word "No Tags" (far right middle of screen). (Or if the commit already has a tag, just use that to create the branch.)
3. Create a temporary tag against the commit. Click the "Create Tag" button to save your tag.
4. Go to the "Create Branch" dialog. Find your tag. Use that!
5. Go back to the commit from step 1. and delete the tag you created.
By cosmic coincidence, this works on both Bitbucket Cloud (bitbucket.org) AND Bitbucket Server! Despite these two Bitbucket implementations being very different, the UI for doing this is pretty much the same in both.
- Sylvie @ Bit-Booster
(We maintain 3 add-ons for Bitbucket Server: Rebase Squash Amend, Git Graph for JIRA, and Control Freak).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I actually hadn't considered doing that. It's certainly not our recommended way of creating a branch from a commit, but you're right - it works!
If someone wants to create branches often then they are probably going to have a clone handy - in which case it would be easier to just do it locally and push the ref. But if this is a one-off, and the person creating the branch doesn't have a local clone, then perhaps doing it in this round-about way would be quicker!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kristy
Even when you have a local clone, some repositories will let you only push commits that are signed by you. (I.e. you won't be allowed to push commits stored in your local clone that are signed by your colleague.)
Cheers
Jarda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can follow steps 1-4, but how do I perform step 5 "Go back to the commit from step 1. and delete the tag you created"? A Bitbucket Cloud commit lists all the tags associated with the commit, but AFAICT it doesn't provide an option to delete a tag.
Either I must leave the temporary tag or use the terminal to delete the tag. And if using the terminal, I might as well use it to directly create the tag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.