Varun Sridharan Varun Sridharan - 4 years ago 117
Git Question

how to find modified branch of a repo using Github Push event

I am using GitHub repo web hook to get to my site pinged when new changes occurs. i dont know who to find which branch is modified.

I referred github docs and in that

The full Git ref that was pushed. Example: "refs/heads/master".

i dont know if that is a correct way to find the modified branch

if yes then will the path will be the same for all repo ?

i get the below json http://pastebin.com/GaFQME7d

Answer Source

As you found out you have all the required information is the GitHub push event. (webhook)

https://developer.github.com/v3/activity/events/types/#pushevent

You already know that the ref is the name of the branch.
And this is the right way to do it, this is what this hook is for.

if yes then will the path will be the same for all repo ?

Yep, you only have 1 main repo with many forks, all the commits should be pushed to your central repo.

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download