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
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
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
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.