How do you rename a Git branch?
a)
git rename branch new-nameb)
git branch -m old-name new-namec)
git branch new-named)
git switch branch new-nameAnswer:
b)
git branch -m old-name new-nameExplanation:
The git branch -m old-name new-name command is used to rename a branch in Git. It changes the name of the branch both locally and remotely if you push the updated branch to the remote repository.
For example, running git branch -m feature-branch awesome-feature will rename feature-branch to awesome-feature.
Renaming branches helps keep your repository organized, especially when the branch name no longer reflects the current work or feature.