colllin
0
Q:

how to change branch name

git checkout <<branchName>>
5
$ git branch iss53
$ git checkout iss53
0
git branch -m <new_name>
33
git checkout <old_name>
0
# Start by switching to the local branch which you want to rename:
git checkout <old_name>

# Rename the local branch by typing:
git branch -m <new_name>

# At this point, you have renamed the local branch.

# If you’ve already pushed the <old_name> branch to the remote repository, 
# perform the next steps to rename the remote branch.

# Push the <new_name> local branch and reset the upstream branch:
git push origin -u <new_name>

# Delete the <old_name> remote branch:
git push origin --delete <old_name>

# That’s it. You have successfully renamed the local and remote Git branch.
0
git push origin --delete <old_name>
0
Rename a local and remote branch in git
Rename your local branch. If you are on the branch you want to rename: git branch -m new-name. ...
Delete the old-name remote branch and push the new-name local branch. git push origin :old-name new-name.
Reset the upstream branch for the new-name local branch. Switch to the branch and then: git push origin -u new-name.
0
git push origin -u <new_name>
0

New to Communities?

Join the community