How do I rename a local Git branch

+1 vote

Hi Guys,

I have created a Git branch in my local system. Now I want to rename this branch. How can I do that?

Sep 4, 2020 in Git & GitHub by akhtar
• 38,260 points
722 views

1 answer to this question.

0 votes

Hi@akhtar,

You can rename your branch name. Sometimes it happens that we randomly create one branch and after that, we need to upload this branch for production. So can use the below command to do so.

$ git branch -m <oldname> <newname>
answered Sep 4, 2020 by MD
• 95,460 points

Related Questions In Git & GitHub

0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,890 points
2,456 views
0 votes
1 answer

How do I solve a Git checkout error: updating paths is incompatible with switching branches?

This error occurs when you are checking ...READ MORE

answered Jul 26, 2018 in Git & GitHub by Sophie may
• 10,620 points
10,524 views
0 votes
0 answers

How do I use git reset --hard HEAD to revert to a previous commit

When I revert this commit: git reset --hard ...READ MORE

May 15, 2022 in Git & GitHub by Kichu
• 19,040 points
873 views
0 votes
0 answers

How do I properly force a Git push?

I have cloned a remote non-bare main ...READ MORE

May 19, 2022 in Git & GitHub by Kichu
• 19,040 points
807 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
+2 votes
1 answer
0 votes
1 answer

How do I go to a particular version of a file in the Git repository?

Hi@akhtar, You can use git checkout <sha1> to check ...READ MORE

answered Jan 5, 2021 in Git & GitHub by MD
• 95,460 points
2,907 views
0 votes
2 answers

How do I install Git on CentOS?

Hi, If you want to install Git 1 ...READ MORE

answered Feb 4, 2020 in Git & GitHub by MD
• 95,460 points
1,057 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP