modified from tortoise git