fix: gitconfig check and gitconfig write placement