How to track new commits with Git?
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.
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?
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.
Git 'fetch' command definitely can do this. So I hope there is some easy way.
No comments:
Post a Comment