![]() |
Renaming branches in Git is important for keeping your repository organized and understandable, especially when collaborating with others. Clear and descriptive branch names improve project management and help team members identify the purpose of each branch. Renaming branches also ensures consistency and clarity throughout the development process. Table of Content Approach 1: Using the ‘git branch -m’ command.Step 1: Open your terminal or command prompt.![]() VS code terminal Step 2: Navigate to the repository directory using the `cd` command.cd <-directory->
Step 3: Initialize git, add commit, add files and create branch.git init Step 4: Now run the following command to rename branch.git branch -m <-old_branch_name-> <-new_branch_name->
and verify it using git branch Approach 2: Using ‘git checkout’ commandStep 1: Open your terminal or command prompt.Step 2: Navigate to the repository directory using the `cd` command.cd <-directory->
Step 3: Initialize git, add commit, add files and create branch.git init Step 4: Run `git checkout “<-old_branch_name->”` followed by `git branch -m “<-new_branch_name->”.git checkout "<-old_branch_name->" |
Reffered: https://www.geeksforgeeks.org
Git |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 16 |