usethis - git issue with origin not being a fork

Hi there!

I've been using usethis::pr_finish() with great success, but just tried it on a private repository, and I had an issue, investigating further with usethis::git_sitrep() I get the following (truncated to just include the following relevant part on pull request readiness:

GitHub pull request readiness
type = 'upstream_but_origin_is_not_fork'
Config supports a pull request = FALSE
origin = 'njtierney/tidy-missing-data-paper' (can push)
upstream = 'njtierney/tidy-missing-data-paper' (can push)
desc = Both 'origin' and 'upstream' are GitHub remotes, but 'origin' is not a fork and, in particular, is not a fork of 'upstream'.

It seems like the situation might be exactly as described: origin and upstream are set to the same repo? Which is an unexpected configuration for Git remotes.

Unless this is a very intentional setup, I would delete the upstream remote. With usethis, use_git_remote(name = "upstream", url = NULL, overwrite = TRUE). With command line Git, git remote remove upstream.

1 Like

Thanks, Jenny! Per your suggestion, I used:

git remote rm upstream

And this has resolved the issue for me!

For my future self / others who may end up here, here is how I came into this position. I have used upstream incorrectly - my understanding was that setting upstream is useful say if I’ve forked a repo and need to tell it where the upstream point is, i.e., the original repository. I erroneously set upstream on my own project to point at origin master, which isn’t needed, since they both point at the same place.

So the lesson for me is, the upstream shouldn't be the same place as origin.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.