0

I'm trying to understand how GitVersion works. Here there is a snippet for 'gitversion /showconfig'

branches:
  develop:
    mode: ContinuousDeployment
  main:
    mode: ContinuousDelivery
  hotfix:
    mode: ContinuousDelivery
...

After shipping the release/1.1, my git is in this state:

  • Master branch has tags 1.0.0 and tag 1.1.0.
  • Develop branch is in 1.2.0-alpha.1.

Now I tried to to simulate an hotfix in production for the release 1.1.0

> git checkout master                                                    
> gitversion /showvariable FullSemVer                                  
1.1.0
> git checkout -b fix/1.1
> gitversion /showvariable FullSemVer                                        
1.1.0
> Add-Content -Name EmptyFile7.txt -Value 'Correction'
> git add --all;  git commit -m "fix(gitversion): modified EmptyFile7.txt"
> gitversion /showvariable FullSemVer
1.2.0-fix-1-1.1+1

I expected 1.1.1-fix-.... and now I don't know how to tag this fix.
For example, is this right?

> git checkout master
> git merge hotfix/1.1
> git tag 1.1.1

Should I handle all this not as a bugfix but in develop/release way?

Riccardo

torek
  • 448,244
  • 59
  • 642
  • 775
Riccardo79
  • 954
  • 4
  • 17
  • 35

1 Answers1

0

The right branch was hotfix and not fix

> git checkout master
> gitversion /showvariable FullSemVer
1.1.0
> git checkout -b hotfix/1.1.1

# Fix
> Add-Content -Path EmptyFile7.txt -Value 'Correction'
> git add --all;  git commit -m "fix(gitversion): modified EmptyFile7.txt"

> gitversion /showvariable FullSemVer                                       
1.1.1-beta.1+1 

Now I can switch to master and approve the hotfix

> git checkout master
> git merge hotfix/1.1.1
> git tag 1.1.1

and finally merge back to develop

> git checkout develop
> git merge hotfix/1.1.1
Riccardo79
  • 954
  • 4
  • 17
  • 35