5 Replies Last post: Mar 21, 2012 3:58 PM by Kirill Likhodedov  
Maciej Kwiatkowski Newbie 3 posts since
Mar 19, 2012
Currently Being Moderated

Mar 19, 2012 5:00 PM

Git update problem: Can't update: no current branch: You are in 'detached HEAD' state

Hi there.

I'm facing a problem with Git support in PHPStorm - I don't know if I am doing something wrong or is it a bug, so after finding nothing simillar, I decided to start a discussion.

 

I have PhpStorim 3.0.3 running on Linux OS and when trying to update project from VCS (Git) I am getting the error as in the topic: "Can't update: no current branch: You are in 'detached HEAD' state, which means that you're not on any branch in Git repository. Checkout a branch to make update possible.".

I am no master in git, but I have read a little about detached HEAD. And still I can't fix it.

This can bo PhpStorm problem (or it's git module) because from within command line there is no problem with fetching and/or pulling. Moreover, the message provided by IDE says: "(...) you're not on any branch in Git repository. Checkout a branch to make update possible.", but it shows my local branch in every window/popup or status bar in the ID (like the one in lower right corner, just before the read-only toggle icon and inspection profile button).

 

So what is the problem?

Right now I have to make updates manually from command line. Pushing commits to remote branches works properly.

Kirill Likhodedov JetBrains 238 posts since
Jun 11, 2010

Have you only 1 Git repository in the project?

 

What happens if you execute 'git branch' in the command line?

Kirill Likhodedov JetBrains 238 posts since
Jun 11, 2010

Probably the submodules are the root cause.

 

Please check for each repository, which branch are you on. Maybe you're in detached HEAD in one of the submodules.

 

You may also want to check PhpStorm EAP (http://blog.jetbrains.com/webide/2012/03/phpstorm-webstorm-4-0-eap-116-101/) - we still don't fully support submodules, but working with multiple roots was improved.

Kirill Likhodedov JetBrains 238 posts since
Jun 11, 2010

The "invalid git roots" error is already fixed. So please try new EAP builds - it should help.

More Like This

  • Retrieving data ...