问题
More specifically, how do I tell if the origin of the repo on disk is a fork of some repo? I am thinking that it should be some API call, but I am not sure. Can I rely on "remote.upstream.url"?
回答1:
You could use the GitHub API for Repositories to get a specific repo
GET /repos/:owner/:repo
(you can use a curl call from command line)
The JSON answer will include a "fork
" field: value true or false.
来源:https://stackoverflow.com/questions/58595716/is-there-a-way-to-determine-if-my-local-clone-is-a-fork-of-some-github-repo