Git change remote branch name

# Rename the local branch to the new name
git branch -m <old_name> <new_name>

# Delete the old branch on remote - where <remote> is, for example, origin
git push <remote> --delete <old_name>

# Or shorter way to delete remote branch [:]
git push <remote> :<old_name>

# Push the new branch to remote
git push <remote> <new_name>

# Reset the upstream branch for the new_name local branch
git push <remote> -u <new_name>

4.71
7

                                    git branch -m &lt;newname&gt;

4.71 (7 Votes)
0
3.6
5

                                    git push origin :&lt;branch_to_rename&gt;
git checkout -b &lt;new_branch_name&gt;
git push --set-upstream origin &lt;new_branch_name&gt;

3.6 (5 Votes)
0
4
2
KIMKU 80 points

                                    git branch &ndash;m old-name new-name

4 (2 Votes)
0
4.5
2
Shawn 100 points

                                    $ git checkout Branch-Name-You-Want-to-Change
$ git branch -m New-Branch-Name

4.5 (2 Votes)
0
4.6
5
Wonka 120 points

                                    git push origin :&lt;branch_to_rename&gt;
git checkout -b &lt;new_branch_name&gt;
git push --set-upstream origin &lt;new_branch_name&gt;

4.6 (5 Votes)
0
4.1
10

                                    1. Verify the local branch has the correct name:
git branch -a

2. Next, delete the branch with the old name on the remote repository:
git push origin &ndash;&ndash;delete old-name

3. Finally, push the branch with the correct name, and reset the upstream branch:
git push origin &ndash;u new-name

Alternatively, you can overwrite the remote branch with a single command:
git push origin :old-name new-name
Resetting the upstream branch is still required:
git push origin &ndash;u new-name

4.1 (10 Votes)
0
3.71
7
Lolol 110 points

                                    $ git checkout Branch-Name-You-Want-to-Change
$ git branch -m New-Branch-Name

3.71 (7 Votes)
0
3
1
Akshay Joy 95 points

                                    git branch &ndash;m old-name new-name

3 (1 Votes)
0
4.25
8
Phoog 110 points

                                    1. Verify the local branch has the correct name:
git branch -a

2. Next, delete the branch with the old name on the remote repository:
git push origin &ndash;&ndash;delete old-name

3. Finally, push the branch with the correct name, and reset the upstream branch:
git push origin &ndash;u new-name

Alternatively, you can overwrite the remote branch with a single command:
git push origin :old-name new-name
Resetting the upstream branch is still required:
git push origin &ndash;u new-name

4.25 (8 Votes)
0
4
4
Nelleke 85 points

                                    git branch -m &lt;newname&gt;

4 (4 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to change name of a branch change name of master branch change branch name in local git how to change current local branch name in git git bash change branch name change branch name in local but not on remote git can i rename remote branch update remote git branch name rename git remote branch chenge name of local branch git rename branche origin change name on branch git changing the name of a branch locally git change name master branch git for new rename created git branch commAND git modify branch name can i change branch name in github chage branch name change my git branch name change branch name in local git remote branch rename command branch name change in git change current branch name git how to change local git branch name change the name of a branch github change the name of a branch git change branch name on remote modify git branch name change branch name in remote can yo uchange branch name in git changing branch name in git change branch name gir change name of branch on github change current and remote branch name change name of master branch git checkout remote branch git change name change branch master name change name branch how to rename remote branch in github how to change branch name in terminal change branch name on git rename a branch in git remote github branch name change rename the remote and local branch rename remote branch git gui git push origin rename branche change the name of remote and local branch in git change a branch name in github chnage branch name git modify remoter and local branch name change branch namein git change branch name on remote] how to change name of current branch git branch chanage name how to change the branch name in github changing git branch name how to change a branch name in github git rename branch from remote change use name branch how to change the name of a branch in git how to change the name of a branch git rename branch but keep remote git change current branch remote git remote branch rename how to rename a branch in git local and remote chnage branch name in git how to change name of a branch in git how change branch name rename git branch command changing the branch name in git git command to rename a remote branch git rename branch delete remote rename branch local and remote git change the name of branch in git change name of a branch git rename branch and push to remote update git branch name how to rename origin branch git change remote branch name in github change a branch name how to change name of branch git change branch name git local and remote git change branchh name change git name branch rename remote brach can you change a branch name in git git branch change remote name how to change branch name in git command change name to a remote branch git change name to a branch git change branch name in github change my branch name git update remote branch name how to rename git branch in local and remote at same time how to change the name of my branch how to change the name of a branch in github rename branch remote and local rename origin master branch rename branch remote change a branch name in git RENAME A GIT BRANCH NAME remote branch name change how to rename branch git remote how to change local branch name When to change branch name git bash git command rename remote branch rename a branch in remote git change local and remote branch name git rename a remote branch git github rename branch remote rename branch name in git remote how to modify branch name in git how to change bracnh name in git rename branch remote branch in github rename branch remote branch change name of the branch git how to chage name branch rename a branch git remote git change the name of a branch change your branch name git git need to change branch name git remote branch change name update remote branch name git changing a branch name git change git local branch name rename a git branch remote git how to switch local branch name rename branch and remote change name of bracnh in git rename remote master branch github to change branch name how to rename github remote branch how to change name of branch change the local branch name in git how change the curent name of you branch in git rename remote git branch name rename branch that is remote rename remote branch that local branch is tracking how to change branch name in github can i change the branch name using git how to change branch names git change name of branch in git change branch name locally in git git branch change name how to change name of a branch in local machine how to git rename remote in local change name master branch git git update branch name how to change the name of a branch git renaming remote branch how to rename the git branch name origin how to change branch name on remote how to change branch name on github git rename remote branch only edit branchname how to change name of master branch git how to change main branch name rename the remote branch name in git rename remote branch name in git branch name change command change both remote and local branch name rename the remote branch in git git renaming a remote branch smartgit rename remote branch update branch name git switch branch name how to chnage the name of the remote defualt git branch how to change the name of the branch in git how to change branch name locally how change branch name in git change branch name on remote and local change local repository branch name change the branch name in github how to chnage git remote branch name how to chnage git branch name how tp rename branch in origin git change main branch name how to change the git brancgh name git change the name of the main branch how to rename a branch in git and push to remote how to change branch name in git bash rename branch name as remote how to change the master branch name in git change branch name to main change the branch name in git git alter name branch renaming remote branch git how to change the branch name rename branch local change a remote branch name rename branch in git remote how to change branch name in local rename branch git on local and remote change branch name git local update branch name in git git how to rename origin branch github change branch name on remote git change master branch name on remote\ can we change branch name in git change local branch name how do I rename remote git branch change branch name on remote rename branch in local and remote change the name of remote branch chang branch name change branch name from github how to change git branch names rename remote branch name change name of origin branch how to edit remote branch name in git change name of local branch change the name of a local branch git git change branch name locally rename remote and local branch change local and remote branch name git change local and remote branch name how to change the remote branch name in git git rename branch on remote and local how to change git branch name in git bash rename branch remote git change branchname git git rename branch name local change the name of remote branch in git change the name of remote brach in git change the name of brach in git apply remote change on local branch name rename branch and push to new remote change name of defult branch git how to rename brance in remote and local how to change a branch name in git how to change branch name in git remotely update branch name git change the remote branch name if i rename branch on local will it change branch on remote can we change git branch name git branch rename remote branch change name of current branch git rename origin branch main hoiw to change the name of a branch change the branch name in local in git git branch rename command rename branch origin change name of git branch locally how to ren rename branch name git change branch local branch name change name of branch git change branch name locally git change current branch name how to update branch name in git change name of a remote branch how to update branch name change the branch name in remote change name of branch remote branch name change change the name of local git branch change branche name git git command to change branch name change the branch name git rename a branch on remote how to change local and remote branch name change a git branch name git chanve branch name change remote branch name git change local master branch name How to rename the branch in remote how rename remote branch git how to change name branch change a local branch name in git how to change branch name in git termianl change name local bracnh github change branch name does rename branch local remote how to change a remote branch name in git git rename branch along with remote git branch rename remote and local can i rename remote branch rename git branch name locally rename git branch name remote git branch rename origin renaming github remote branch how to rename local and remote git branch git how to rename a remote branch change name branch remote change name branch github change branch name in local and remote git rename branch and remote change a name of a branch git git change name of head branch change name to local branch how to change the name of local branch in git change branch name git command line git change name of master branch edit branch name github how to change name of the branch git github rename origin branch how to change the name of the current branch terminal how to rename the branch name in git git rename branch remote shuold i change branch name locally and remote rename remote git branch how to rename remote branch ig g change branch name local git change name of branch git change the branch name change local branch name git change name of branch github change the name of the branch rename git remote default branch git rename a branch remote git + change the branch name git-svn rename remote branch update name of branch git how to change the branch name in git git changing branch name how to change the name of branch github git change local branch name how to change branch name git chane branch name git github rename branch in remote rename branch name git branch rename remote how to change name of git branch how to change the current branch name in git chnge branch name edit git branch name how to rename git remote branch name change name of a branch git how to change branch name change current branch name rename a remote branch how to rename branch on remote how to change the name of created branch in git how to change a branch's name in git push rename branch to remote how to change git branch name in local edit branch name git command change branch name change branch name local how to chance branch name rename a local and remote branch in git after changing branch name in git rename a branch alredy pushed git checkout rename branch rename git branch name git rename remote branch git git change name remote branch how to change your branch name in git git change name of branch gitz rename branch name local branch change branch neame how to rename remote feature branch in git rename local branch name how to change origin branch name in git rename bracnh git change branch name and push to remote how to change a local branch name git rename origin branch git rename a branch name git local branch renae how to rename a git branch locally change branch name to remote change branch name github in git rename branch that is commited and push in origin git branch rename local and remote change name git branch how to rename git branch local update branch name command line git error rename branch change name of local branch git how to change branch name in command line how to rename my latest commit on remote branch how to change branch name local and remote renam branch can i rename my branch how to remname baranch name in git rename git branch remote and local change bran name git git remote branch renamed git rename brnach rename branch git origin git can you rename a branch rename a git branch remote and local change name of current branch bitbucket rename branch change the branch name after creation git command rename current branch git renaming a branch rename a remote branh git rename but can't create branch add remote rename branch git command rename git remove old branch rename git branch and remove old branch rename git branch and remove branch how to rename git branch remote renaming a git branch git how to rename branch name how to change the name of branch in git branch rename git rename for git branch how to rename github branch name git command rename branch git branch frename current branch rename local branch github how to rename git branch command line rename a branck git git branch name update git rename remote origin branch git rename branch command rename remote branch github git remote rename git change current branch remote remote branch change author git remain branch renaming a branch in github git push rename local branch to remote change branches git git change name on local branch rename a branch github git change branch remote git branch --move new old rename branch git remote how to rename branch how to rename branches in git how to change branch name locally and remotely git change name of current branch how to change local branch names remote branch rejected rename how to change the name of a branch on git git change name local name and remote name remane a branch in git how do you change the name of a branch how to change the name of the branch on git changethe name of a branch git rename branch on git git how to rename branch how to rename remote branch in githyb how to change remote branch Change the branch name on server git how to change the name of a branch in remote branch rename a local branch name git from different branch rename a local branch name git from different brancg rename a local branch name git how to update remote branch name how to change git branch name in git command for renaming the branch in git how to rename branch from the terminal git rename branch remote and locally git renaming brnach git change brancgh name git branch renaming for remote branch how to change github branch name how to rename a branch in github rename a branch githib update branchs names git change branch name in git git change origin branch name renam branch git how to change branch in remote git how to rename a local and remote branch in git how to rename remote git branch how to change name of remote branch in git can you change a remote branch name git change remote origin branch name git push renamed branch git how change branch name how to rename git branch local and remote change a branch name git bash how to rename branch name git how to renamin a git branch how to change name of git local branch rename gut branch how to edit branch name in git git rename current branch local how to rename a branch in git locally can you rename a release branch rename branche git how can i change branch name in git how to rename a branch in github cli change branch name remote how to rename gi branch git change name to a branch git rename original branch git rename upstream branch git rename a loca branch hoq to edit branch name in gitlab how to rename a branch using git command how to changes branch name rename git brnach push force git after rename branch rename the branch nam ein git git bash rename local branch and remote git rename a branch local and remote change my local branch name git branch renname change name of remote branch git how change name branch rename a branch locally rename branch on remote chnage a branch name in git git branch name changes reflect to origin how to change the name of branch git rename corrent branch how to create name/branchname in git rename origin branch github rename branch problem change branch name local and remote renaming branch git local and remote rename branch locally in git git rename branch origin change the name of a git branch renamle branch git push rename branch github change name of remot branch amend git branch name hwo to rename a branch how to rename a local branch and change the upstream origin ho to change name of local branch git branch chnages branch name git rename branch name git change name branch local an remote is there a way to rename a branch in git rename my local branch git how to rename remote branch github how rename branch git git renme branch renommag branch git git branch to change name how to change name of remote branch how to rename remote branch how to rename branch name using git bash change upstream branch name git rename orgin branch change branch name and push remote goit rename remote branch change name in local branch change branch name github local and remote branch git rename local branch and push to remote update branch name local git how to change git remote branch name how to update the branch name in git rename branche rename branc how to remname branch git how to change remote branch name change name of brach local and remote change remote branch name how ton rename branch how to rename the branch name rname current branch name git extensions change git branch rename local and remote git rename branch in remote chagnge the branch name how to rename remote branch name in git rename the current branch name change branch name on local and origin change name on local branch Git remote branch name change github rename branch local and remote change git branch name local change git branch name local and remote git push origin new name git remote rename branch rename current git branch change name for remote branch when did git change repo branch name rename branch on origin rename branch on or how to name old branch rename branchs can i rename a banch name git how to rename branch name in git branch name for new change git git change remote branch name git change branch remote name rename branch and push to remote how to rename a brsnch in git how to give branch name in git rename origin branch github rename branch in team teamviewer rename branch on remote github git rename branch on local how to change branch name in git remote rename branch in git repo git how to change remote branch name git rename branch* change branch name terminal what is the name of my local branch? how to change branch name in git local and remote push a rename change to branch to remote how to change the branch name? git ? rename branch in local and remote gitlab rename branch in local and remote gitla rename branch in local and remote git renameing git branchg change g branch name how to rename a git branch name how to change the git branch name change branch name in git local and remote GIT how to rename remote branch how to rename a branch both locally and remotely how to rename my branch in git rename a remote branch in git git rename branhc how to rename branch locally and remotely git b rename rename branch in github command local branch rename rename local branch git command change branch names git change branch name git command how to rename local branch change branch name from local nad remote how to rename origin branch git edit local branch name how to rename brtanch how to rename branch origin how to rename a branch in git bash how to rename branch locally rename git change name remote branch git rename remote branch without deleting how to push a renamed branch in github change name of remote branch rename a local branch rename bot local and up branch git branch name edit how to rename a branch name in git how to change git branch name local how to change branch name in git repository git checkout remote branch and rename the branch can i change branch name in git git rename local branches how to rename a branch rename local and remote branch how to rename local and remote branch in git git rename branch name remote changing the branch name in local git to rename local and remote branches in git git how to rename a local branch can we change the branch name in git commands to rename remote branches in git commands to rename local and remote branches in git change branch na,e git git rename origin branch name git rename branch name local and remote git branch rencame how to change my git branch name git rename branch on gitbash git change bracnh name change name of local git branch git update remote branch name how to rename current branch in git rename branch git local and remote change local git branch name github rename branch rename git brancch branch change name git renmae branch git how to change branch name in git local how to update a branch name in git rename a local branch in git renaming git branch locally rename branch git cli git rename brunch change name of branch git remote how to rename base branch in git how to change remote branch name in git how to rename branch github command line rename local branch name in git rename github branch upstream how to change name of branch in git git rename branch on local and remote renaming branch in git can i rename a git branch change branch name git remote edit git branch name cli rename branch git in terminal change the name of a branch in git git rebname branch git push new branch renamed git how to change the name of your branch git command to rename a local branch git rename uncommited commit rename branch git remote and local rename a git remote branch rename a local branch git rename branch git command to rename branch in git can you change brunch name in git can i rename a local branch in git git rename remote branch name git rename branch in local and remote github rename a branch rename branches git cli how to rename remote branch in git change name of git branch git change my branch name how to rename branch in git git rename local branch name how to change a git branch name change the name of the branch git change a branch name git change name branche git git reaname branch renaming the git branch change local branch name in git rename current branch git git rename the branch in remote also git rename the branch git change remote branch name git change branch name in remote git renaming branch github rename remote branch rename branch git bash rename origin branch git rename a remote git branch renaming a branch in git how to rename local git branch git rename local and server branch change the name of a branch git git rename current branch how to rename local branch in git rename branch name git git rename branch command line rename remote branch git how to rename an existing branch in git rename git branch via command line rename github branch name change name branch git rename branch name in git command rename git branch remote git set branch name git change branch name remote how to rename git rbanch git how to change branch name how to change the name of git branch how to change current branch name in git can we rename a git branch how can i rename a branch in git git rename a remote branch modify name of branch git how to rename the branch in git local git change name of branch local git rename local and remote branch how to renamea git branch can you change the name of a git branch git push rename branch rename a branch in git local and remote changing branch name on git for remote and local rename local and remote branch git git how to rename local branch change name of working branch git change branch name git bash git command to rename branch how to rename a branch git rename branch local and remote github rename branch] rename curret git how to update branch name rename branch locally and remotely git how to rename the origin branch in github how to change a branch name rename remote branch rename abranch change the name of branch git rename remote branch in git change name local branch git change the branch name when push to remote rename current branch how to rename my branch in github change branch namr rename a branch change brnahc name git rename branch git rename branch rename local branch renaming a branch branch rename in git git change name branch change git branch name remote change branch name git how to rename a git branch locally and remotely how to rename a git branch rename pushed branch git branch name change how to rename git branch remame branch git change name of local branch how to rename branch name in bitbucket rename remote bra how to rename remote branch git rename branch locally git fix branch name git change branch name local git rename branch remote rename git branch local and remote how to change git branch name via terminal change branch name git change branch name and push git rename remove remote branch vs code rename branch how to update branch name in git remotely rename the branch name in git how to change branch name in git rename branch after push git how to rename local branch git change the name of current branch git change name of current local branch git git rename branch on origin vscode rename branch git renam branch git rename an existing branch how to rename a local branch in git how to change local branch name in git chage branch name git git rename branch local and remote how rename git branch github rename local and remote branch git rename branch remote and local rename a branch git bash rename git local branch how to rename the branch in git renme git branch rename branch git local how to edit a branch name in git git update branch name remote git rename a branch to develop rename git branch rename local git branch git edit branch name git branch rename local git push local branch to remote change name how to change the local branch name in git git branch name rename how to rename branch git rename local branch git rrname git branch rename branch origin git how to rename branch in git locally and remotely git rename branch locally how to rename a branch in git git rename remote branch renaming remote branches in git renaming branches in git git rename branch locally and remotely git rename branch git renaming git branch change git branch name git change branch name local and remote git change branch name on server git change branch name command line rename a branch in git modify branch name git how to change git branch name how to change the name of a git branch rename a branch git rename branch name in git git cheange branch name GIT RENAME BRANCH LOCAL branch renaming in git rename a git branch how to rename a remote branch in git renaming local branch git change the name of a remote branch git git remane branch renaming branch git how to change the name of a git btranch git rename a branch git change branch name rename branch git name rename git branch locally rename branch locally git git branch rename rename branch in git git rename local branch git rename branch edit branch name git
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source