Pergunta

Why can't I run git clone in the background. Is this a downloading limitation or a git limitation or something else completely?

git clone <repository> &
Foi útil?

Solução

This should work just fine. However, you should be aware that "in the background" doesn't mean "where I can't see it". The command may still output data to the screen (which git certainly does), overwriting whatever you're currently doing. This is purely cosmetic.

To run it in the background without anything showing on screen, you can redirect its output to /dev/null:

git clone yourrepo > /dev/null 2>&1 &

If you want to be able to inspect the output later, replace /dev/null with mylogfile.txt

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top