Shell/Bash: git rename branch Example

By

Shell/Bash Example: This is the "git rename branch" Example. compiled from many sources on the internet by SimpleTutorials.org

git rename branch

git branch -m   # Any Branch
git branch -m  # Current Branch

# For windows if you get "Branch already exists" error
git branch -M 

git rename remote branch

# Rename the local branch to the new name
git branch -m  

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

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

# Push the new branch to remote
git push  

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

rename branch git

git branch -m 

git rename branch

git branch –m old-name new-name

git push origin :old-name new-name
git push origin –u new-name

git rename branch

git push origin :old-name new-name

git rename branch

git push origin –u new-name

Xem thêm: active directory user kopieren per powershell



* Summary: This "git rename branch" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others