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

Linking between two bitbucket repositories

Ramakrishna chaitanya rachumallu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 14, 2023

Hi,

I have two repositories on Bitbucket: repository A and repository B. I wish to merge the code from repository B with repository A while repository A was being executed locally on my local PC. Can this be done?

Thanks in advance

1 answer

1 accepted

1 vote
Answer accepted
Erez Maadani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 15, 2023

Hi @Ramakrishna chaitanya rachumallu 

In general, yes, merging/linking repositories is possible, but you need to be more specific on your expected outcome.

In most naive case, merging just the code, you can just copy a snapshot of the code in repo B into repo A.

If you are done developing repo B and you want to keep its history, you can add repo A's remote to repo B, and *push repo B's branches to the new remote - Note: you will have to do some merges/renaming for branches with same name like: main, master, dev, etc'. 
You can see more detailed answer here: https://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories 

If you wish to keep on developing repo B, there are several approaches with different outcomes and different working methodologies after the link. 
Have a looks at these links:

Ramakrishna chaitanya rachumallu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 16, 2023

Thanks. I used git submodules as suggested and it solved my issue

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events