title: How to track new commits with Git?
body: <p>I'm writing an external Git plugin. It should process commits in Git and create some entity in another system if commit contains some text. Note that I want to search through all entire repository, not some branch. Also I have storage in my plugin, so I can store some revision SHA for example</p>
  
  <p>I clone Git repository locally and fetch it periodically. During fetch I want to discover which new commits were added since last synchronization. Is there any easy way to do this?</p>
  
  <p>One solution is to create local branches, and after fetch discover the difference between local branch and origin branch. But what to do if there was forced update on remote branch? In that case difference can be huge, and the same commits can be processed twice. Also if I will use local branches solution, and new branch is added on remote server, I definitely do not want to process all commits in new branch, just the unique one.</p>
  
  <p>Git 'fetch' command definitely can do this. So I hope there is some easy way.</p>