I've cloned a GitHub repository onto my local machine. I'd like the state of my local repository to reflect its state at a specific commit, so my instinct is to git checkout <commit>. However, doing so results in an error:
fatal: reference is not a tree: 7aa823a959e1f50c0dab9e01c1940235eccc04cc
Viewing the commit on GitHub yields the following warning:
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
What are my options? If it helps, the GitHub repository is the Linux kernel source tree and the commit in question is 7aa823a959e1f50c0dab9e01c1940235eccc04cc.
git cat-file -t 7aa823a959e1f50c0dab9e01c1940235eccc04ccto see if the object exists at all in your repository (it probably doesn't). GitHub uses some funky stuff behind Git's back to combine storage for forks, and this means that sometimes you can "see" a commit that isn't actually there, through their web interface. This appears to be such a case. If you can figure out which fork actually holds that commit, you could clone that fork.