I want to create a Java application that monitors a GitHub repository, pulls changes to the machine it is running on and triggers a method when something in the repo has changed.
while(true)
{
if(new commits on the remote github repo)
{
pullChanges();
doSomething();
}
}
I am currently using JGit and regularly deleting the local repository to clone a new one and compare the combined file size to check if anything has changed. This is incredibly hacky and not reliable (if a commit just changes a letter, the file sizes would be the same)