Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • TC LI schemas definitions TC LI schemas definitions
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • LI - Lawful Interception
  • TC LI schemas definitionsTC LI schemas definitions
  • Wiki
  • How to
  • Rename a Branch

Rename a Branch · Changes

Page history
Initial copy from trial area authored May 23, 2022 by canterburym's avatar canterburym
Hide whitespace changes
Inline Side-by-side
How-To/Rename-a-Branch.md 0 → 100644
View page @ e9c340a9
**Renaming Git Branch is currently only possible through command line, if you are not comfortable doing this either contact a [maintainer](Process/Maintainers) for help or in GitHub delete the branch and recreate it.**
Follow the steps below to rename a Local and Remote Git Branch:
1. Start by switching to the local branch which you want to rename:
`git checkout <old_name>`
2. Rename the local branch by typing:
`git branch -m <new_name>`
At this point, you have renamed the local branch.
If you’ve already pushed the <old_name> branch to the remote repository, perform the next steps to rename the remote branch.
3. Push the <new_name> local branch and reset the upstream branch:
`git push origin -u <new_name>`
4. Delete the <old_name> remote branch:
`git push origin --delete <old_name>`
That’s it. You have successfully renamed the local and remote Git branch.
Clone repository
  • Checklists
    • Rapporteurs Checklist TS 103 120
    • Rapporteurs Checklist
  • Conventions
    • Branching convention
    • CR form conventions
    • Drafting rules
    • Merge Request convention
    • Rendering conventions
    • Tagging convention
  • Guidelines
    • Guidelines for example data
  • How To
    • Comment On A CR
    • Create a CR
    • Create a meeting branch
    • Join a project
    • Log in
    • Rename a Branch
View All Pages