2

It happened somehow that I left the master branch and ended up on the no branch branch. How can I give this branch a meaningful name?

In detail: Calling git branch shows

* (no branch)
  master

and what I want (without changing any file) is to have e.g.

* extraBranchIEndedUpWith
  master

git status is clean.

1 Answer 1

7

"no branch" is not a branch, as the name says. It means you have checked out a revision that isn't the tip of a branch.

To create a branch of it, simply

git checkout -b extraBranchIEndedUpWith

Just like you would create any other branch from your current revision.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.