- Git rename local branch
# If you're currently on the branch you wish to rename:
git branch -m new_branch_name
# If you're not on the branch you wish to rename:
git branch -m old_branch_name new_branch_name
- Check the remote repo
git remote -v
- Git remove the remote branch
git push remote_repo_name --delete old_branch_name
- Git push branch
git push --set-upstream remote_repo_name new_branch_name
网友评论