Check if a branch is empty
问题 Is there a way to check if a branch is empty using the github API? /repos/:owner/:repo/branches/:branch returns the last commit, but how do I check if the commit belongs to the same branch or the parent branch? 回答1: As illustrated in "Find the parent branch of a git branch", a git branch has no "parent branch". A branch can be empty compared to another, and ahead compared to another: --x--x (branch1) \ o--o (branch2, branch3) Here, branch3 could be considered "empty" when compared to branch2