Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git rename remote branch

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

rename branch remotely git

git push origin :old-name
git push origin new-name
Comment

Git change remote branch name

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 ––delete old-name

3. Finally, push the branch with the correct name, and reset the upstream branch:
git push origin –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 –u new-name
Comment

Rename git branch remote and local

# 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>

# Prevent git from using the old name when pushing in the next step.
# Otherwise, git will use the old upstream name instead of <new_name>.
git branch --unset-upstream <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>
Comment

rename remote branch in git

git push origin :<branch_to_rename>
git checkout -b <new_branch_name>
git push --set-upstream origin <new_branch_name>
Comment

rename branch remote

git branch -m new_name
git push <remote> :old_name new_name
Comment

PREVIOUS NEXT
Code Example
Shell :: curl hide output 
Shell :: run apache xampp 
Shell :: cordova-ios latest version 
Shell :: onlne compiler c linux 
Shell :: how to install cuda on ubuntu 20.04 
Shell :: how to install wine in ubuntu 18.04 
Shell :: git branch from commit 
Shell :: dos view all files 
Shell :: git pull request 
Shell :: how do I push a repo that says allready exists 
Shell :: access from ip pgsql running in docker 
Shell :: raspberry pi default username 
Shell :: dukto for ubuntu download 
Shell :: yarn add global 
Shell :: doc.find is not a function 
Shell :: recursive grep recursion depth 
Shell :: How to change default install location for pip 
Shell :: how to run .rpm file in linux 
Shell :: no source map sass 
Shell :: add group 
Shell :: npm install compression 
Shell :: check port running 
Shell :: commit unstaged changes to new branch 
Shell :: where does pip install packages 
Shell :: download images from url terminal 
Shell :: git ignore not saving changes 
Shell :: sudo apt install xfce4 xfce4-goodies -y 
Shell :: lxml parser 
Shell :: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. 
Shell :: ubuntu nvm 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =