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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 10, 2018 in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

249 views 14 2
Join discussion

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