How to create a new branch from a tag? How to create a new branch from a tag? git git

How to create a new branch from a tag?


Wow, that was easier than I thought:

git checkout -b newbranch v1.0


If you simply want to create a new branch without immediately changing to it, you could do the following:

git branch newbranch v1.0


I used the following steps to create a new hot fix branch from a Tag.

Syntax

git checkout -b <New Branch Name> <TAG Name>

Steps to do it.

  1. git checkout -b NewBranchName v1.0
  2. Make changes to pom / release versions
  3. Stage changes
  4. git commit -m "Update pom versions for Hotfix branch"
  5. Finally push your newly created branch to remote repository.
git push -u origin NewBranchName

I hope this would help.