I have a few repositories on my Github account and I am trying to pipe a list of names of all these repos (private and public) to some scripts for automating a few tasks.
What I did-
- Read a lot of QnA on this, but most answers revolve around
git remoteor similar commands that I found are irrelevant to the problem. I still checked out its examples to be sure about this. Few others answered how to list locally stored repos but that would mean cloning each of them. I believe these two don't make this a duplicate question. - Browsed the git documentation, but nothing seemed to allow this operation
- Thought about cloning the entire account (somewhere around 7gb..) Please dont make me do this
Any ideas?
The only way to find this information is via the GitHub API (e.g., using this API call), which will require an HTTP client and some JSON parsing. Usually, this will be done via
curlandjq, but you can also do it with a language such as Ruby.This information isn't exposed by Git because Git doesn't expose the concept of having a single account on a server with multiple, discoverable repositories. Many sites hosting repositories don't have this concept, either. Fugitive is just a wrapper around Git, so it also doesn't have this concept, although there are extensions to support it working with GitHub that may provide this functionality.