Epistemic Status: Sprouting - This is a zettelkasten-style card about a concept I’m interested in remembering.
GitHub creates their own refs for pull requests to keep those commits from being garbage collected. They exist under refs/pull
which by default doesn’t get fetched or cloned.
To fetch all of these refs locally, you can edit the config to include those refs in fetches. I don’t know if there’s a command line option to set this, since it’s a multi-value field.
[remote "origin"]
url = <fetch-url>
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/pull/*:refs/remotes/origin/pull/*
Then the next git fetch
will pull down the pull request refs. You might not want to do this on a repository with lots of pull requests, since you’ll be pulling down all the commits on those PRs you might not already have, especially in repositories where squash merges are being used.