Linked Questions
39 questions linked to/from How can I rename a local Git branch?
5 votes
1 answer
11k views
How do I rename the local Git branch? [duplicate]
I don't want to rename a remote branch, as described in Rename master branch for both local and remote Git repositories. How can I rename a local branch which hasn't been pushed to a remote branch? In ...
8 votes
1 answer
18k views
How to rename and move branch in git (bitucket/sourcetree) [duplicate]
We have a branch called ABC-Awsome_Branch , that is "saved" in feature/3.0.0, so it looks like: feature/3.0.0/ABC-Awsome_Branch But the branch was created with an incorrect name, and even not in the ...
6 votes
1 answer
3k views
move a branch path in git (change its name, not its code) [duplicate]
we have a branch on remote called release/service-release-2016 I want to rename the branch to release/completed/service-release-2016 for archiving and clarity. How do I do this? Everything I ...
7 votes
0 answers
191 views
Rename local branch which isn't pushed into remote repo yet [duplicate]
I've created a new branch in local with below command and started working on code changes. master> git checkout -b "mybranch" Later, I realized that I needed to follow our standard and that I ...
1 vote
0 answers
92 views
Rename branch to "master" without merging? [duplicate]
I have a single-developer app that was originally written in Python. A few years ago, I decided to try porting it to Go, mainly as a learning exercise. I created a new branch go-port that I used for ...
1954 votes
25 answers
1.7m views
git: how to rename a branch (both local and remote)?
I have a local branch master that points to a remote branch origin/regacy (oops, typo!). How do I rename the remote branch to origin/legacy or origin/master? I tried: git remote rename regacy legacy ...
891 votes
17 answers
335k views
Rename master branch for both local and remote Git repositories
I have the branch master which tracks the remote branch origin/master. I want to rename them to master-old both locally and on the remote. Is this possible? For other users who tracked origin/...
339 votes
2 answers
201k views
Change a branch name in a Git repo [duplicate]
How do I rename an existing branch in a Git repo? I want the current branch to have a new name.
133 votes
8 answers
88k views
How do I rename my Git 'master' branch to 'release'?
We would like to enforce a new policy for our projects that the master branch now be called the release branch to ensure it is more clear as to how the branch should be used. Naturally, we will have ...
53 votes
3 answers
33k views
How can I rename my branch from TortoiseGit?
I know the way to rename branch from command line, but - since I'm using TortoiseGit - I'm curious if there are any options to do such thing. Thanks for the answers :)
33 votes
4 answers
48k views
git branch -M main
One of the things github now recommends is changing the branch to main instead of master. The code given on the github site is: git branch -M main That never works for me, so I thought I would ...
13 votes
4 answers
21k views
Git problems with git push --all
I have a base repository that lives on a UNC \machine\share ....etc. I have a local clone that I work on in the master branch and occasionally merge over to the "stable" branch. usually I do a git ...
13 votes
2 answers
10k views
Can't checkout git branch started with hyphen (-)
I have cloned a git repository. This repository has a remote branch something like -feature-abc. When I type git checkout -feature-abc, I get: error: unknown switch `e' Any idea how to checkout this ...
7 votes
2 answers
6k views
Group git branches
I've taken over a big git repository with lots of branches that no one really seems to know what they are all about. Is there any way to put branches in some kind of grouping or folder so that they ...
10 votes
1 answer
48k views
How to make Head point to master in git?
Please help to make Head point to master in git I tried to git rebase HEAD master and git checkout master Nothing of those helps. Updated: Strange I tried: git symbolic-ref HEAD refs/heads/...