Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ error: branch 'origin/HEAD' does not point at a commit, some refs could not be read

Tags:

People also ask

How to see Git Branches in IntelliJ?

In the Branches popup or in the Branches pane of the Git tool window, select a branch that you want to check out locally from Remote Branches, or Common Remote Branches if your project has several roots and synchronous branch control is enabled, or from Repositories | Remote Branches if it is disabled.

How to update branch in IntelliJ?

Update branchIn the Branches popup or in the Branches pane of the Version Control tool window, select a branch and choose Update from the context menu.

How do you push changes from detached head to branch?

If you want to keep changes made with a detached HEAD, just create a new branch and switch to it. You can create it right after arriving at a detached HEAD or after creating one or more commits. The result is the same. The only restriction is that you should do it before returning to your normal branch.

How do I push to a branch?

To push the branch or you can say to push the changes in the branch to the Github repo you have to run this command “git push origin <the branch name>” in our case the branch name is “main”. After pushing the changes the repo will look like and this is how you can push a branch to a remotely hosted GitHub repository.


As far as I can tell everything in my git local repository is fine. I can commit, push, pull, whatever I like.

However, when I view the details of a commit in the IntelliJ log, the Contained in branches:

Can not load branches due to error:
error: branch 'origin/HEAD' does not point at a commit 
error: some refs could not be read 
error: branch 'origin/HEAD' does not point at a commit 
error: some refs could not be read

What could have caused this and how do I fix it?