Nerdbank.gitversioning: Branch policies does not allow the usage of prepare-release

Created on 31 Mar 2020  路  2Comments  路  Source: dotnet/Nerdbank.GitVersioning

If you create branch policies on the master branch, it is not possible to use the prepare-release command because the command creates commits on master branch when run.

Any suggestion how to solve this?

question

Most helpful comment

Sure: after running nbgv prepare-release, use these commands:

git checkout master
git push origin HEAD:refs/heads/your-topic-branch
git reset --hard origin/master

This will roll back your local master branch to match origin/master after first pushing your local master to origin while renaming it.
Then create a PR from your-topic-branch to the central master branch.

All 2 comments

Sure: after running nbgv prepare-release, use these commands:

git checkout master
git push origin HEAD:refs/heads/your-topic-branch
git reset --hard origin/master

This will roll back your local master branch to match origin/master after first pushing your local master to origin while renaming it.
Then create a PR from your-topic-branch to the central master branch.

:-D sometimes you just think too far...thanks an sorry to bother you...

Was this page helpful?
0 / 5 - 0 ratings