Merging files back & forth git repositories

We currently have a BitBucket git repository with TeamA and RepoA.  I'd like to make a Team B and RepoB that is a clone of RepoA. The TeamB people are free to commit whatever they want to RepoB.  They don’t have access to RepoA. TeamA will continue working on RepoA. Completely separate worlds. 

At times, I’ll need to merge some changes from RepoB up to RepoA.

Additionally, I’ll be resetting RepoB to be an exact copy of RepoA again. Thereby bringing TeamB up to the latest TeamA work and the cycle will repeat.

I’ve been a git user for several years but am not sure how to accomplish this. What is the best way? 

Is there a way for RepoB to know it’s a clone of RepoA and still be in BitBucket?

1 answer

My answer assumes you're using Bitbucket Server (as opposed to Bitbucket Cloud).

Try the fork button (directly in the Bitbucket Web UI)!   Make sure the "[x] Enable fork syncing" option is enabled for the fork.  This way all the original branches in the TeamB fork stay up-to-date with their TeamA counterparts.  

Once this is in place you can create pull-requests (also directly in the Bitbucket Web UI) to merge work from the TeamB repo back into the TeamA repo.   TeamA members can use the Pull-Request as a medium to review and iterate on the work before they click the "Merge" button.

I suspect something roughly equivalent to this is also available in Bitbucket Cloud (aka bitbucket.org).


p.s.  I'm the author of Bit-Booster for Bitbucket Server (a paid add-on).

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,751 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you