create and apply patch in git