Variable Substitutions in Code

I am trying to figure out a way to create variables on my master that can be changed when merged with branches. Here is an example: I have a Master, BranchA and SecondBranch. The code in Master is the same in the other two branches except for a few lines. Those lines are specific to each branch. The way I have it set up right now I have to pull Master locally, make the branch specific changes, then push it out to the correct branch. What I would like to do;

Make changes to Master without searching for the branch specific code,

Merge Master with BranchA and have that code automatically changed.


I know I sound lazy but being able to do this would save me about an hour a day of searching and changing, this doesn't count the time fixing something I may have missed. And since I have been working with Git for just over a week, missing something can be a pain. 

Thanks in advance.

1 answer

I am fairly confident that what you're asking for is not a feature of Git (so also would not be a feature of Bitbucket or Sourcetree).

To be certain, you might pose the question in a forum or QA site dedicated to Git power users, which I admittedly am not.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

694 views 5 9
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