fix various bugs in gitinit