Skip to main content

Questions tagged [git-detached-head]

Use this tag for questions about a Git repository in "detached HEAD" mode. A repository is in this mode if `git status` says "HEAD detached at ..." or "HEAD detached from ..."

git-detached-head
0 votes
1 answer
84 views

Should I checkout to a branch before updating changes on a remote submodule in Git?

I have my main project called "MP" and it depends on a submodule repo called "SM" (just fictional names for this question). I just have my 'main' branch on MP and a 'main' branch ...
Cblue X's user avatar
  • 327
0 votes
0 answers
27 views

Can I recover a commit to a detached head after I've returned to main [duplicate]

I am using Github Desktop. I have a repository containing a unity project. Within that repository I have a submodule that containes a bunch of unity things that I use in every project. I commited and ...
Scott's user avatar
  • 1
0 votes
1 answer
59 views

git/submodule: NOT a detached ahead after update --checkout

As per documentation man git submodule update, if run with an option --checkout then it should leave submodules's HEAD in a detached state. --checkout This option is only valid for ...
TruLa's user avatar
  • 1,127
1 vote
1 answer
73 views

git/submodule: detached ahead after update --rebase

As per documentation man git submodule update, if run with an option --rebase then it should never leave submodules's HEAD in a detached state. --rebase This option is only valid for the ...
TruLa's user avatar
  • 1,127
1 vote
1 answer
69 views

Git Detached Head in Android Studio

I am using Git with Flutter and recently I noted that doing a commit I get the message about a Detached Head. I would like to remove the detached head situation. This was probably generated by the ...
user15690472's user avatar
2 votes
1 answer
86 views

Set an existing branch to detached HEAD (after `git rebase --onto`)

When I have a detached HEAD that's several commits ahead of an existing branch, what's the right command(s) to advance that branch to the detached HEAD without changing anything in my working ...
Justin Grant's user avatar
0 votes
1 answer
71 views

Git: abandon bad commit and make HEAD the mainstream

I made some changes to this repository and checked them in and pushed (4326b5, "Waypoint"), before falling back to the previous well behaved commit, 64b7d01 "Merge commit". Then I ...
Joymaker's user avatar
  • 1,285
1 vote
1 answer
141 views

Resolving Detached Head on Server in Copied "Test" Site and original "Live" Site

Introduction I am managing a Drupal 9.4 site as a novice GIT and composer user, having built it out using these tools and limiting plug-ins to only those I absolutely needed to build out the ...
duncanf's user avatar
  • 11
0 votes
0 answers
77 views

How to make a separate branch when in detached head state?

I took over a project in a detached HEAD state. I don't know for how many commits it's been in that state. I'm currently on main and want to create a new branch feature1. When I create this branch and ...
gkeenley's user avatar
  • 6,998
0 votes
1 answer
123 views

HEAD is detached in the repository [repo_name] and no branch selected - NetBeans

I'm using NetBeans to develop a project in Java. Whenever my mate tries to push what he has done, it shows the error: HEAD is detached in the repository [repo_name] When I go to the Repository ...
gipsywontmakeit's user avatar
-1 votes
1 answer
330 views

Detached head state in closed development environment

A similar question has been asked already, however it does not provide the solution for my situation. My origin/develop branch is in a closed environment (azure devops) and can only be changed via a ...
Eeuwigestudent1's user avatar
0 votes
2 answers
309 views

"HEAD" equivalent in detached HEAD state

Lets say I'm in a detached HEAD state and I run the following command: git push origin HEAD:foo git will output the following error: error: The destination you provided is not a full refname (i.e., ...
Simoyd's user avatar
  • 506
0 votes
2 answers
151 views

What's the best way to find old detached HEAD after repo sync?

Say that there are some local commits(A, A1, A2, A3) on the current detached HEAD which points to commit A, after repo sync, the local detached HEAD is overridden with the remote latest detached HEAD ...
Chen Li's user avatar
  • 5,132
2 votes
1 answer
49 views

Is there a way to undo detached HEAD state without undoing the work I've done while in detached HEAD state?

I'm in a detached HEAD state but have made a bunch of commits while in detached HEAD that I can't lose. Is there a way to undo the detached HEAD state without losing any of my work?
gkeenley's user avatar
  • 6,998
1 vote
0 answers
44 views

Detached Head state on the Git remote repository

When I clone an existing project, the project doesn't point to the tip of the branch, but to a commit, so the HEAD is detached. If I perform a "git checkout theMainBranch", that allows ...
PascalLyon's user avatar

15 30 50 per page
1
2 3 4 5
7