HEAD
Git reported the above error, which literally means “wrong default version of head”. Let’s figure out what head
is. The GIT manual says:
The head file is a symbolic reference to the branch you’re currently on. By symbolic reference, we mean that unlike a normal reference, it doesn’t generally contain a SHA-1 value but rather a point to another reference.
the head file is a symbolic reference to the current branch. By symbolic reference, we mean that, unlike a normal reference, it usually does not contain a SHA-1 value, but a pointer to another reference.
In short, the head
file points to the current branch. If you do not create a custom branch, head
points to the Master
branch by default. Open the head
file, and you can see:
$ cat .git/HEAD
ref: refs/heads/master
The head
file is a link file of the file refs / heads / Master
. When we create a new user-defined branch, such as dev
, switch to the branch and submit the modification under the branch, head
points to the branch where the modification was made dev
, and open the head
file
$ cat .git/HEAD
ref: refs/heads/dev
Therefore, GIT reports an error bad default revision 'head'
, which means that the current branch of head is wrong.
terms of settlement
- Modify symbolic links
You can also manually edit this file, but again a safer command exists to do so:
symbolic ref
.
you can modify thehead
file manually, but there is a more secure command to do it: symbolic Ref.
for example, I changed head
from pointing to Master
to pointing to dev
:
git symbolic-ref HEAD refs/heads/dev
Switch branches and submit again
reference resources
Git: fatal: bad default revision ‘head’ git internal – git references creating and merging branches – Liao Xuefeng git tutorial
Read More:
- Error: Command failed: git describe –always fatal: Not a valid object name HEAD
- error: cannot open .git/FETCH_ Head: permission denied resolved
- (26)RuntimeError: Error(s) in loading state_dict for YoloBody:size mismatch for yolo_head3.1.weight
- Error: You have not concluded your merge (MERGE_HEAD exists)
- [git] report error and solve cannot open.git/fetch_ HEAD: Permission denied
- Error: can’t locate revision identified by ‘xxx’
- [problem record] installed build tools revision 31.0.0 is broken during Android studio compilation
- Error in creating index by Google elasticsearch head plug-in
- Failed to find Build Tools revision 27.0.3
- TypeError: Failed to execute ‘fetch‘ on ‘Window‘: Request with GET/HEAD method cannot have body.
- Project error – failed to find build tools revision 26.0.1
- gradle:failed to find Build Tools revision 29.0.2
- Failed to find Build Tools revision 25.0.2
- You have not concluded your merge (MERGE_HEAD exists)
- Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager
- “Android.””IDE,” CMakereward Invalid revision: 3.18.1-g262b901-dirtyerror
- Adobe finally launched Photoshop fix on Android, a powerful mobile phone map revision app
- 2021-07-27 Android studio:Installed build tools revision 31.0.0 is corrupted.Remove and install ag
- [actual record of Android stepping on the pit] Android studio runs with errors. Installed build tools revision 31 is broken
- failed to find Build Tools revision 23.0.2 Install Build Tools 23.0.2 and sync project