Skip to content

Restrict push access to GitHub public repository #23761

Discussion options

You must be logged in to vote

First thing to check would be if the push URL for your repository (git remote show origin) is using SSH or HTTPS, because that tells you which kind of credentials to look for.

If SSH: Check if any of the keys registered in your GitHub account (Settings > SSH and GPG keys) matches any of your identity files (~/.ssh/id_*.pub, assuming OpenSSH and the same paths as on Linux). If so, login is expected to work without configuration in git.

If HTTPS: I haven’t used this from the command line so this is going to be vague, but you’d be looking for a cached password or access token. While looking up other stuff earlier I noticed that on Mac git can use the system keychain, so maybe it’s that?

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants