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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Unrelated branch commits history pushed

Edited

I'm working with JetBrains PhpStorm and integrated one Bitbucket and one Github remote repositories at once. Bitbucket repository was created much later, and had only one commit, with the working tree of the github master branch.

After making some changes in the github branch, I made "git checkout bitbucket" (local branch tracking Bitbucket master), "git commit", "git push".

After that, I have that one more commit in the Bitbucket master branch, but also, on the Bitbucket Commits tab, I have like a separate branch with all the commits from Github, it is before master and of different color.

However, I don't need those commits and didn't intend to push them, I also don't see them in the PhpStorm Git tab. I can't see that branch on the Bitbucket Branches tab, and when I click any of its commits, its branch is shown as "master", and points to a branch that doesn't have that commit!

How is this possible and how do I delete these unrelated commits from my Bitbucket repository?

On the screenshots you can see that "da40a66" is actually the same as "844cf5c", but created earlier

image.pngimage.pngimage.png

1 answer

1 accepted

0 votes
Answer accepted

Turns out that branch appeared when I accidentally pushed the tags from all branches (including Github master), and they pulled their history with it.

When I run "git push --delete bitbucket 4.3.0 4.0.1" (the last and first tags of the Github master), it disappeared.

Still, it was misleading to me that the branch name was "master" although it wasn't related to Bitbucket master. And it linked to the branch page that didn't have those tags, so I could only see them on the Commits tab.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events