26 Equivocal remote setups
Just like the previous section about the most common setups, we only consider a very constrained set of remotes:
- The remote is on GitHub, e.g. its URL looks something like
https://github.com/OWNER/REPO.git
orgit@github.com:OWNER/REPO.git
. - The remote is named
origin
orupstream
.
The setups described here are characterized by incomplete information. This section exists mostly to explain feedback that the usethis package might give about a GitHub remote configuration.
To identify any of the remote setups described in section 25, we need information from GitHub:
- Whether you can push to a repo
- Whether a repo is a fork
- For a fork, what is its source repo
Sometimes some of this information is publicly available, but some of it never is, such as repo permissions. This means that programmatic access to this information, i.e. requests to the GitHub API, generally requires authorization by an authenticated GitHub user.
This means that client packages, like usethis, work best when you have configured a GitHub personal access token (PAT). See section 9.3 for more details on why and how to do that.
If you’ve configured a PAT and are being told your GitHub config is problematic, consider these other explanations: Are you offline? Is GitHub down? Have you lost permission to access the repo? Has your PAT expired? By default, they now expire after 30 days.
26.1 Maybe “ours” or “theirs”
When we detect just one GitHub remote, but we can’t verify the info above, usethis describes the setup as “maybe_ours_or_theirs”.
Once a PAT is available, this setup can be identified as being “ours” (belonging to you), “ours” (but belonging to someone else), or “theirs”.
26.2 Maybe fork
When we detect two GitHub remotes, but we can’t verify the info above, usethis describes the setup as “maybe_fork”.
Once a PAT is available, this setup can be identified as being a well-configured fork or a fork with incomplete setup (or possibly something more weird).
26.3 How to fix
These setups aren’t necessarily broken, but usethis needs more information to operate.
To “fix” this, set up a GitHub personal access token. See section 9.3 for more details on why and how to do that.