0

Is it possible to see detached head state in IntelliJ?

IntelliJ swears it can't operate on Git due to detached head, but no any sign of this state is visible in log. The only sign is that hexadecimal branch is displayed in the lower right corner.

Is it possible to show all commits in log and observe detached head state?

Dims
  • 47,675
  • 117
  • 331
  • 600
  • I'm not completely sure what you're looking for… Are you looking for something specific beyond what's in the Log tab of the "Version Control" tool window? –  Jul 01 '16 at 11:58

1 Answers1

1

If the current file you are viewing belongs to a repository in detached head state, in the status bar where it usually shows the branch you are on (e.g. Git: develop) you will instead see just the the first few digits of the commit's id (e.g. Git: 8b5bd014.

If you open up (VCS | GIT | Branches...) you will see in the Repositories section that the current branch is the commit id. You can create a branch pointing at that commit by clicking on that line and choosing (+ New Branch). You can switch to a branch by selecting an existing branch from the list and clicking on "Checkout" in the pop up menu

Hank D
  • 6,271
  • 2
  • 26
  • 35
  • This helped me - I hadn't notice that in the status bar vs. jumping to the command line. It's a quick way of sorting it out. – TimM Apr 02 '17 at 20:06