DEV Community

lnoueryo
lnoueryo

Posted on

Renaming a Git Branch

Rename feature/a to feature/b

# make sure that feature/a is selected on the local branch
git checkout feature/a

# rename the local branch to feature/b
git branch -m feature/b

# push the new branch to the remote
git push origin feature/b

# delete the old branch on the remote
git push origin --delete feature/a
Enter fullscreen mode Exit fullscreen mode

Top comments (0)