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.
Join now to unlock these features and more
I have the odd issue that i seem to have branches from other repos in other repos. At first this appeared in source tree but not on the WebPortal. I assumed sourcetree was having some sort of issue seeing multiple branches and was incorrectly showing them.
However it appears that i am seeing commits and branches that shouldnt be in the a repository as they are from another?
Has anyone had something similar? Probably something we've done although its a strange occurrence as our Repo are separate??
Hi Tim and welcome to the community!
While it is not common practice, it is possible to add in repo1 a branch that belongs to repo2.
For example, you can add a second remote to a clone of repo1 with
git remote add second_remote email@example.com:my-workspace/repo2.git
Fetch all references:
git fetch --all
Create in the clone of repo1 a branch that tracks the remote branch feature from repo2
git checkout -b feature --track second_remote/feature
and then push this branch to repo1 with
git push origin feature
where origin is the remote repo1.
You can delete both locally and in the Bitbucket Cloud repo any branches that shouldn't be there. However, I would suggest checking with your team first, in case there was a reason someone pushed this branch to repo1.