Using a Git branch as a permanent method of segregating a portion of a code base. Good or bad?

We have a product, called 'AFE'. That product has several OS specific versions (Linux, iOS, Windows, etc.). We are considering using permanent branches in BitBucket to segregate these platform specific portions of the master code. Reasoning is to make our Bamboo triggers (on commits) focus only on one platform, as opposed to them all.

Has anyone done something similar? Any issues you've encountered, or you can see being a problem with permanent branches? Any alternative suggestions?

Thanks in advance.

1 answer

1 accepted

There would be pros and cons. One pro is that you would be in a good position to manage platform-specific bugs in the common code. The con, however, is that you need to do a lot of merging between the branches to ensure the common code remains common.

An alternative would be to keep one branch, but use patterns to include or exclude particular files (probably folders) in the build.

For example, if you had a folder structure like this:
-- common
-- ios
-- linux
-- windows

You could use a pattern of

^((common)|(ios))/.*

to include the common and iOS folders.

(Inclusion and exclusion patterns can be defined in the 'Advanced Options' section of the repository configuration)

Good answer. This addresses the need nicely, not sure how we missed that option!

Cheers.

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,768 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