VDone Demo VDone Demo
Home
  • Articles

    • JavaScript
  • Study Notes

    • JavaScript Tutorial
    • Professional JavaScript
    • ES6 Tutorial
    • Vue
    • React
    • TypeScript: Build Axios from Scratch
    • Git
    • TypeScript
    • JS Design Patterns
  • HTML
  • CSS
  • Technical Docs
  • GitHub Tips
  • Node.js
  • Blog Setup
  • Learning
  • Interviews
  • Miscellaneous
  • Practical Tips
  • Friends
About
Bookmarks
  • Categories
  • Tags
  • Archives
GitHub (opens new window)

Nikolay Tuzov

Backend Developer
Home
  • Articles

    • JavaScript
  • Study Notes

    • JavaScript Tutorial
    • Professional JavaScript
    • ES6 Tutorial
    • Vue
    • React
    • TypeScript: Build Axios from Scratch
    • Git
    • TypeScript
    • JS Design Patterns
  • HTML
  • CSS
  • Technical Docs
  • GitHub Tips
  • Node.js
  • Blog Setup
  • Learning
  • Interviews
  • Miscellaneous
  • Practical Tips
  • Friends
About
Bookmarks
  • Categories
  • Tags
  • Archives
GitHub (opens new window)
  • 技术文档

    • Git User Manual
    • Markdown Tutorial
    • Common npm Commands
    • npm package.json Properties Explained
    • YAML Language Tutorial
    • Renaming a Git Branch
      • Renaming Both a Local Branch and Its Remote Counterpart
  • GitHub技巧

  • Nodejs

  • 博客搭建

  • 技术
  • 技术文档
xugaoyi
2022-08-11
Contents

Renaming a Git Branch

# Renaming Both a Local Branch and Its Remote Counterpart

Before renaming, make sure the local branch is up to date and that the rename won't break anything for your teammates.

  1. Rename the local branch
git branch -m oldBranchName newBranchName
1
  1. Delete the remote branch
git push origin :oldBranchName
# or: git push origin --delete oldBranchName
1
2
  1. Push the renamed local branch to the remote
git push --set-upstream origin newBranchName
1
Edit (opens new window)
Last Updated: 2026/03/21, 12:14:36
YAML Language Tutorial
GitHub Advanced Search Tips

← YAML Language Tutorial GitHub Advanced Search Tips→

Recent Updates
01
How I Discovered Disposable Email — A True Story
06-12
02
Animations in Grid Layout
09-15
03
Adding a Scrollbar to a Table's tbody with CSS
06-29
More Articles >
Theme by VDone | Copyright © 2026-2026 Nikolay Tuzov | MIT License | Telegram
  • Auto
  • Light Mode
  • Dark Mode
  • Reading Mode