Git: Stop git push

Viewed 32183

I'm pushing a large file to git, but have a very slow connection. What is the safest way to terminate this push (mid-push), and resume it when I have a better connection?

3 Answers

Before Git 2.30 (Q1 2021), "git push"(man) that is killed may leave a pack-objects process behind, still computing to find a good compression, wasting cycles.

This has been corrected and illustrates how safe it is to kill a push in progress.

See commit 8b59935 (20 Nov 2020) by Jeff King (peff).
(Merged by Junio C Hamano -- gitster -- in commit adae5df, 03 Dec 2020)

send-pack: kill pack-objects helper on signal or exit

Signed-off-by: Jeff King

We spawn an external pack-objects process to actually send objects to the remote side.
If we are killed by a signal during this process, the pack-objects will keep running and complete the push, which may surprise the user.

We should take it down when we go down.

Related