1

How can you check if the latest branch commit has been pushed into the master via the Github API?

JaySlack
  • 13
  • 3

1 Answers1

0

That would be the GitHub API "Refs"

GET /repos/:owner/:repo/git/refs/:ref

I showed (in 2015) a more complete example here.

But don't forget a simple git ls-remote would also show you the latest commits of the remote repo branches.

Compare that with "How to retrieve the hash for the current commit in Git?"

git rev-parse master

And you can check if that local master HEAD commit has been pushed or not.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250