Hi Guest
MobileUser
HomePage
Jobs
WalkIn
Articles
Agile
DotNet
WebServices
Mathematics
OOPS
WEB
SharePoint
Java
DataBase
Artificial Intelligence
BigData
Android
XML
Agile
Software
SEO
Science Techonlogy
Repository Questions
PHP
Frameworks
Server
Testing
HR
Java
TPF
Tutorial
Tools
Test and Papers
Silverlight
Science Techonlogy
----- Select Country -----
----- Select Location -----
----- Select Category -----
:) Latest Topic
GitLab
SourceForge
Launchpad
Phabricator
Gogs
Beanstalk
GitKraken
Launchpad
AWS CodeCommit
Gitea
Rhodecode
:) Hot Jobs
:) Latest Articles
Follow
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
Input Your Comments Or suggestions(If Any)
Name
Email
(optional)
Comments
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
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)
Home
About Us
GroupChat
Sitemap
Feedback
Contact us