Improved git handling