Hi Guest

HomePage

1 1

To improves our performance please Like Share Subscribe(Will boost us)

How can you rename a Local or Remote Branch in Git?
Question Posted on 12 Mar 2022

Home >> Repository Questions >> Git Questions >> How can you rename a Local or Remote Branch in Git?

How can you rename a Local or Remote Branch in Git?
Git is one of the famous version control system which is used by software developers to keep track changes in their application and collaborate with others. One of the main feature of Git is branches.
Here different people works on different branches before merging their changes with the original code.
And you can add new features or fix bugs on a different branch without affecting to the original code.
And there are certain situation when you need to change the name of local branch or the remote branch. Below are the steps to change the name of branches:-

(1)Rename a local git branch:-

(i)In first step to see branche run below command
git branch --list or git branch -a

(ii)Now in second step switch to branch you want to rename by below command
git checkout branch-name

or we can use below command to switch to branch
git switch branch-name

(iii)In last step we will run the command to rename the branch
git branch -m new-name


(2)Rename a Remote git branch:-Rename a Remote banch is not same as local branch.
(1)In first step delete the old name by running below command
git push origin --delete old-branch-name

(2)In second and last step reset the upstream branch to the name of your new local branch by running below command
git push origin -u new-branch-name

And to check this rename log into your client website and check the repo.
0
0



Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions
Why Git is fast and which language is used in GIT?
What is syntax to fix a broken commit in GIT?
What is GitLive new features that will change the game?
What is Subgit and what is the use of this?
Difference between Git and SVN






Most Visited Questions
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |
     
 
Privacy policy | Terms and Conditions | Blog


If the copyright of any questions or content or syntax belong to you email us we will remove that(info@crackyourinterview.com or crackyourinterview2018@gmail.com)
 

1
Home About Us GroupChat
 
Sitemap Feedback Contact us