8

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 correct folder. So the correct path/name had to be like: feature/2.5.0/DEF-Awsome_Branch . Now this branch contains some commits, etc...

It's possible to "move" and rename the branch to the correct name and path?

We use Bitbucket , and sourcetree.

1

1 Answer 1

10

This should do the trick:

git branch -m old_branch new_branch # Rename branch locally git push origin :old_branch # Delete the old branch git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote 

Source here

Do not forget to pull before you do this, so you won't lose anything that was not previously pulled.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.