In this tutorial you will learn how to rename a local branch in Git using the “git branch -m” command.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# Git Rename local branch # Info about current project git status git branch ls -al .git/ cat .git/HEAD ls -l .git/refs/heads/ # -m Move/rename a branch and the corresponding reflog git branch -m info_tmp_1 git branch -m info_tmp_1 info_1 git branch -m feature_2 info_2 cat .git/HEAD ls -l .git/refs/heads/ # Man page man git-branch |