Fix "git fetch" lines to work in "detached head" state