How to name a (no branch)-branch on git

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

  • Vim does not open Git branch files
  • move commits from one branch to another
  • git clone from local to remote
  • TFS client, GIT backend?
  • Alias that displays how many commits branches are ahead/behind master
  • Assigning certain commands to users
  • * (no branch)

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

    * extraBranchIEndedUpWith

    git status is clean.

  • Resolving Git merge conflicts
  • How to push different local Git branches to Heroku/master
  • How not to display the .class in git
  • Git status slow on VMWare guest but not host
  • How to revert Master branch to upstream
  • Android - The prefix “xmlns” cannot be bound to any namespace explicitly; neither can the namespace for “xmlns” be bound to any prefix explicitly
  • One Solution collect form web for “How to name a (no branch)-branch on git”

    “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.

    Git Baby is a git and github fan, let's start git clone.