Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with GitHub organization #63

Closed
JDLH opened this issue Sep 23, 2024 · 4 comments
Closed

Problem with GitHub organization #63

JDLH opened this issue Sep 23, 2024 · 4 comments

Comments

@JDLH
Copy link

JDLH commented Sep 23, 2024

git fetch from my GitHub repo fails with "remote: Repository not found." despite apparently successful Oauth.

How to reproduce

  1. In Terminal, install git-credential-oauth in my git installation on macOS using MacPorts.
  2. Perform % git credential-oauth configure. Successful.
  3. cd to local clone of a GitHub repo.
  4. git fetch. Command prints (line breaks added for legibility):
https://github.com/login/oauth/authorize?client_id=deadbeef...
&code_challenge=blah_blah_elided&code_challenge_method=S256
&redirect_uri=http%3A%2F%2F127.0.0.1%3A53123&response_type=code
&scope=repo+gist+workflow&state=blah_blah_elided
  1. I am prompted for a GitHub login, and I successfully login. (Or I see a browser tab which says, "Success. You may close this page and return to Git.")

Observed behaviour
Command's output continues,

remote: Repository not found.
fatal: repository 'https://github.com/MyUserID/my-repo.git/' not found

Git fetch does not occur.

Expected behaviour
No error message. git fetch succeeds.

Discussion
The repository URL 'https://github.com/MyUserID/my-repo.git/' appears to be correct. I suspect that the repository is present on the remote, but that authentication was not acceptable to GitHub, and so they tell the command that it is not present.

Setting the helper command to oauth -verbose prints out lines beginning query:, token:, and output:, but does not give any kind of diagnostic reporting a failure.

@andreobrown
Copy link

@JDLH I ran into the same issue. Is the repository that you're trying to clone a part of a GitHub Organization? If so, you'll need to follow these instructions to allow OAuth access for git-credentials-oauth: #58 (comment)

@JDLH
Copy link
Author

JDLH commented Sep 24, 2024

@andreobrown Thank you for the hint! Yes, the repo I am trying to access is related to a GitHub Organization. Specifically, it is my GitHub account's clone of the organisation's repo, and the repo contains a submodule which refers to another of the organisation's repos.

Following the instructions at Requesting organization approval for OAuth apps, in the page for Application git-credential-oauth, under Organization access, I see the name of the owning GitHub Organization, and an "X" implying no access, and a "Request" button which I can push to ask the org to grant me access.

If this turns out to be the underlying cause, then I may propose a Pull Request with an improvement to the git-credential-oauth documentation to cover this situation better.

@JDLH
Copy link
Author

JDLH commented Sep 24, 2024

I have asked my organisation to approve my use of git-credential-oauth. If/when they grant it, and it works, I intend to report back here.

For what it's worth, I filed a GitHub Docs issue #34710 Clarify use of OAuth credential helpers in local Git installation and Pull Request #34712 Patch for #34710, improving caching credentials with oauth mention. If those get accepted, then that may prevent future occurrences of this issue and #58 appearing in this project's issues list.

@hickford hickford changed the title git fetch from my GitHub repo fails with "remote: Repository not found." despite apparently successful Oauth. Problem with GitHub organization Oct 16, 2024
@hickford
Copy link
Owner

Added documentation for GitHub organizations in 5be89d5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants