Stash branches and product (NuGet) version numbers strategy

We are evaluating Stash and are wondering how to set the product version number (in the assemblyinfo files), which is then published to NuGet, when following the GitFlow branch model.

In our current (non-Git) repository we have a version.txt file which exists for each branch. This version.txt file is used (when we do a build) to update all the assemblyinfo files with this version number, and is used when publishing the assemblies to NuGet. However this version.txt file 'sticks' to each branch. i.e. we do not merge it from develop into master.

e.g. master has a version.txt file which contains "2.0.0"

      develop has a version.txt file which contains "2.1.0-dev"

      feature/MyFeatureA has a version.txt file which contains "2.1.0-featureMyFeatureA"

With our current repository when feature/MyFeatureA is merged into develop we merge all the files except the version.txt file. 

Now using Stash (git) we won't be able to do this because all the files will be merged, so after the merge the first thing we would have to do is update the version.txt file again to revert it back to '2.1.0-dev'. This wouldn't be particularly helpful for having a streamlined dev process for merging feature branch or bug fix changes.

Do you have a recommended approach for doing this? I did notice https://github.com/Particular/GitVersion which uses the branch name to derive the version number rather than using a version.txt file.

Craig

1 answer

Read this. The "Merge strategies" section describes very nicely how to apply "git merge -s ours" to solve this problem.

Suggest an answer

Log in or Join to answer
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...

708 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot