Saturday, August 22, 2020

Rename Branchname In Git

Rename Git Branch Name Locally and Remotely.

Step-1 Go to your branch
git branch <old_branch_name>
Step-2 Git command to rename the local branch name
git branch -m <new_branch_name>
Step-3 check branch name changed
git branch
Step-4 if you have already push the old branch to remote repository then push your new branch and delete old branch.
push new branch and reset the upsteram
git push origin -u <new_branch_name>
Delete old branch from remote repository
git push origin --delete <old_branch_name>

No comments:

Post a Comment