gitPublishSync deletes .git folder
This happens when Gradle thinks the output directory is stale even if it has been told to preserve the .git folder
This happens when Gradle thinks the output directory is stale even if it has been told to preserve the .git folder