Is there a way to determine if my local clone is a fork of some github repo?

こ雲淡風輕ζ 提交于 2020-02-22 14:43:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!