Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git change branch name

git branch –m old-name new-name
Comment

change branch name git local

// If you are in a different branch:
git branch -m old-name new-name

// If you are in the same branch:
git branch -m new-name
Comment

Change a branch name in a Git repo

If you're currently on the branch you want to rename:

git branch -m new_name 
Or else:

git branch -m old_name new_name 
You can check with:

git branch -a
As you can see, only the local name changed Now, to change the name also in the remote you must do:

git push origin :old_name
This removes the branch, then upload it with the new name:

git push origin new_name
Comment

edit branch name git

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

git change local branch name

git branch -m <newname>
Comment

change branch name

 $ git branch -m <new_name>
Comment

change branch name

git branch -m <newname>
Comment

change branch name

git branch -m new-branch-name
Comment

how to change branch name

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.
Comment

git rename a local branch

git branch -m <new-branch-name>
Comment

PREVIOUS NEXT
Code Example
Shell :: git revert file to master 
Shell :: github desktop brew 
Shell :: how to stop port 8080 
Shell :: get powershell version 
Shell :: kill port windows 
Shell :: git clone from specific branch 
Shell :: install rvm ubuntu 20.04 
Shell :: ec2 ubuntu default password 
Shell :: how to install gatsby with typescript 
Shell :: load new etc rules 
Shell :: extract ros bag file data to csv 
Shell :: download video cart driver for manjaro 
Shell :: how to follow a file url in vim 
Shell :: give all privileges to single player minetest 
Shell :: date linux show millis 
Shell :: rustup 
Shell :: remove global configuration in git 
Shell :: get username linux 
Shell :: change git commit date 
Shell :: how to check installed packages in linux command 
Shell :: notify once a job is completed 
Shell :: install mongodb with brew 
Shell :: flutter web run using vscode 
Shell :: downgrade npm package to specific version 
Shell :: how to I display powershell function code 
Shell :: powershell find in history 
Shell :: run bash script in its directory 
Shell :: openssl generate certificate 
Shell :: docker bash command 
Shell :: vim sudo write 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =