How did I end up with a detached HEAD?
问题 I checked out a commit/branch from master, and then checked out back to master and wrote something. After that, I committed it, but I ended up with a detached HEAD. Why? Here is what I did: Create a new project and create git repository. git add git commit type some words git commit checkout to previous commit checkout back type some word try to commit; it prompts there is a detached head. IntelliJ IDEA's console shows: 17:08:58.143: cd C:\Users\jiahao\IdeaProjects\testtt\src 17:08:58.143: