I'm working on a PHP app, using three main branches: 'master' (current stable release), 'bugfix' (for patches) and 'next' (for next minor version).
We store the current version number in the code - it's used for a few things including checking for updates to the app, and also simple cache-busting for CSS/JS files (like
styles.css?v=1.2.3) which helps when updating.
My problem is regarding merge conflicts. Say I have version 1.2.3, and 'next' is branched off there to start work on version 1.3. I change the version in that branch to
1.3.0-dev. Then I need to fix a bug in the 1.2 line, so the 'dev' branch is patched and version 1.2.4 is released.
But now when I merge the changes into the 'next' branch I get merge conflicts, because the same line was edited in both branches. Are there any strategies to avoid this? Or should I just resolve the merge conflict and move on?
I've seen a few answers across SE that talk about using git tags (which we do use for releases) but I don't think that really helps my situation since we need the version number in the code.