From c11708e710ea171af9b8762afcf1d8c3e86a1caf Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Fri, 18 Oct 2024 10:07:02 +0100 Subject: [PATCH] docs: info about reverting version increments --- .../repo-management/version-control.md | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/docs/dev-guide/repo-management/version-control.md b/docs/dev-guide/repo-management/version-control.md index 94113b0..9b04c51 100644 --- a/docs/dev-guide/repo-management/version-control.md +++ b/docs/dev-guide/repo-management/version-control.md @@ -69,20 +69,22 @@ and automated changelogs. - When you decide it is time to create a new version: -1. Create a new branch + ```bash + pip install commitizen # (if not installed) - `git checkout -b bump/new_release` + cz bump --check-consistency --changelog -2. Bump the version and push + git push + git push --tag + ``` - ```bash - pip install commitizen # (if not installed) + - cz bump --check-consistency --changelog +!!! warning - git push - git push --tag - ``` + This assumes you have repo write access and are working on the main branch. + + This will: @@ -94,8 +96,24 @@ This will: - Automatically update CHANGELOG.md with all changes since the last version. - Create a tag matching the version number. -> Note: in a repo where you have direct push access, you would simply -> update on main and push. As we are using Git-Flow, a PR is necessary. + + +!!! tip + + Oh no I made a mistake! + + Worry not, the version increment can be reverted: + + ```bash + # Revert the commit + git reset --soft HEAD~1 + + # Delete the branch + git branch -d v0.x.x + git push --delete origin v0.x.x + ``` + + ## Creating Releases