Whereas I'd think that leaning on git when possible makes more sense than trying to roll it yourself. Managing the state of the repository is exactly the thing that git is good at.