An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
October 25, 2022 07:49 pm GMT
Original Link: https://dev.to/smpnjn/git-renaming-a-branch-27g0
Git: Renaming a Branch
Git branches are an easy way to manage our code, and separate our copies of our code when we want to work on specific features. We can then merge our code back into our main branch, or even rebase it.
Sometimes, though we make a mistake in the naming of our branch. Maybe you wrote fea-ui-design
instead of feat-ui-design
, or maybe you just want to rename your branch completely. Fortunately, it's easy to rename a branch. First switch to the branch you want to rename using checkout
:
git checkout my-branch
And then use the -m
option on branch
to rename it.
git branch -m new-branch
Now my-branch
has been renamed to new-branch
- it's as easy as that!
Original Link: https://dev.to/smpnjn/git-renaming-a-branch-27g0
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To