Fork GitHub inside Bitbucket cloud & define Bitbucket as the deployment source inside Azure web app

john peter October 28, 2024

Hi All,

 

I want to Fork this GitHub repository microsoft-teams-emergency-operations-center inside our Bitbucket repo, as we need to do some customization which are specific to our organization. 

 

So, I did those steps: -

1) Clone the GitHub Repository to my Local Machine

git clone https://github.com/OfficeDev/microsoft-teams-emergency-operations-center.git

2) Define Bitbucket repository as a remote

git remote add bitbucket https://bitbucket.org/bitbucket-username/bitbucket-repo-name.git

3) git fetch bitbucket

4) git push bitbucket main

5)then i modified some files using Visual Studio Code

6) git add . git commit -m "Saved" 

7) git push bitbucket main

 

Where we got the GitHub files inside Bitbucket, then I created a new Web App inside Azure, and I defined the Bitbucket repo as the deployment source and i did the deployment. and everything seems to work well.

 

image.png

 

Then today i did 2 modifications/commits to the Bitbucket repo files on the cloud, as follow:-

image.png

and i noted that 2 new deployments were executed automatically inside Azure Web App.

image.png

 

 

So, I have those questions: -

 

1) Are my steps to Fork a GitHub repo inside Bitbucket valid? or I am doing thing wrongly?

2) Now let say the upstream on GitHub do new changes, will those changes get applied directly to our Bitbucket? and hence the Azure web App will get a new deployment? If this is the case, then can we prevent this? so we can test any changes done on the upstream before getting them deployed automatically inside Azure Web app?

 

Thanks

 

 

1 answer

1 vote
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 29, 2024

G'day, @john peter 

It's not possible to have a fork repository from two different git platforms. Essentially, a fork refers to a copy of a repository linked to the original repository on the same platform. This linkage makes it easy to contribute to the original repository by creating pull requests.

You can clone a GitHub repository to your local machine and then push it to a new repository on Bitbucket. However, this does not link the two repositories directly as a traditional fork would on the same platform.

There isn't a direct way to achieve this. It will likely involve manually pulling the latest change locally, changing the url to the Bitbucket platform, and pushing the new changes.

I hope this helps.

Regards,
Syahrul

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events