有没有办法确定我的本地克隆是否是某个github存储库的分支?

时间:2019-10-28 17:30:50

标签: git github fork clone

更具体地说,如何确定磁盘上回购的来源是否是某个回购的分支?我认为这应该是一些API调用,但是我不确定。我可以依靠“ remote.upstream.url”吗?

1 个答案:

答案 0 :(得分:1)

您可以使用GitHub API for Repositoriesget a specific repo

GET /repos/:owner/:repo

(您可以使用curl call from command line

JSON答案将包含“ fork”字段:值为true或false。