10 questions
2
votes
3
answers
196
views
Why can't I detach an orphan's HEAD?
I'm trying to make my Git script resilient to various weird situations that can occur in repository.
I have it working correctly with detached branches and orphaned branches but it will probably not ...
0
votes
1
answer
87
views
Make commits outside HEAD
Can I make an arbitrary commit at the end of branch dev when HEAD is not on dev? How?
My git branches look like this at any moment:
There is a master branch, from which a couple of feature branches ...
0
votes
1
answer
64
views
Bring Changes from a commit HEAD into a branch
I have a feature branch ff which is based on main.
I want to bring changes made by a commit HEAD abcde on top of ff.
How can I do this?
0
votes
1
answer
168
views
Getting ` warning: refname 'HEAD' is ambiguous.` after `git clone --bare` and `git worktree add`
I'm lookng into git worktrees b/c I want to work on multiple branches at once. Did the following setup
# Created new E:\ partion
cd /d E:
mkdir repos
cd repos
git clone --bare <repository-url>/...
-2
votes
1
answer
72
views
What HEAD operations happen upon a git pull?
When I do git fetch origin main I get:
From github.com:company/app-ios
* branch main -> FETCH_HEAD
However when I do git pull main I don't get any mention of ORIG_HEAD or ...
0
votes
2
answers
167
views
What can make git be unable to find the git repository even though the .git folder is there and the HEAD content is correct?
Due to a syncing problem, I lost some files. I check git status and it says:
fatal: not a git repository (or any of the parent directories): .git
But the .git folder still seems to be fine:
ls .git
...
0
votes
1
answer
96
views
Difference between "git reset HEAD <filename>" and "git reset -- <filename>"?
When I stage a file, "git status" then mentions that, to UNstage that file, I can do "git reset HEAD filename". But I have also seen instances in which the recommended command is &...
0
votes
1
answer
870
views
git: how to revert to a previous commit and continue from there? [duplicate]
[git newbie here]
I have the following commits:
[c1]-->[c2]-->[c3]-->[c4]-->[c5]
HEAD is now at c5 but I realized that c4 and c5 are not good and I wish to continue from c3. In other ...
265
votes
6
answers
119k
views
What is the HEAD in git?
There seems to be a difference between the last commit, the HEAD and the state of the file I can see in my directory.
What is HEAD, what can I do with it and what mistake should I avoid?
309
votes
4
answers
138k
views
HEAD and ORIG_HEAD in Git
What do these symbols refer to and what do they mean?
(I can't find any explanation in official documentation)