What does git diff compare to if HEAD is detached?
From the man page (but I don't get it): git diff [--options] --cached [<commit>] [--] [<path>...] This form is to view the changes you staged for the next commit relative to the named <commit>. Typically you would want comparison with the latest commit, so if you do not give <commit>, it defaults to HEAD. If HEAD does not exist (e.g. unborn branches) and <commit> is not given, it shows all staged changes. --staged is a synonym of --cached.
It makes no difference whether HEAD is detached or not. Detached HEAD does not mean that HEAD is not available, just that HEAD is pointing to some commit directly, not to a branch.
How to get current state of HEAD in git?
Pushing local repository changes to a Github
IntelliJ losing modules after Github cloning
If a git branch is pushed to the remote and then deleted before it is merged, is it still part of the repository history?
git beanstalkapp staging branch has all changes from master branch but master doesn't have all changes from staging
How to not commit temporary debug statements
Git move everything in a directory one directory up
To localhost from server deployment of Jenkins + Sonar
Why is my .git/objects folder 175GB?
Jenkins pipeline branch name returns null
Gitlab migration - clone Issues & Merge Requests
Git - Pushing big file gives error, remote: fatal: error when closing sha1 file: Input/output error
Git undo deleted files after commit and push
Git Hooks Remote Work Tree Commit
How to remove folder subtree from a git repository? Is that possible?
Azure git push returning 403