The answer should explain why git is trying to access Gitlab, Bitbucket or anything else (in my case it is Gitlab), even if the pre-push script is not completed
The pre-push hook was introduced in the commit ec55559, January 2013, Git v1.8.2-rc0
It was part of the as/pre-push-hook patch:
See Commit 87c86dd , commit ec55559 , commit 5a7da2d (January 13, 2013) by Aaron aschrab ( aschrab ) .
(Combined by Junio C Hamano - gitster - in commit bb9a696 , January 24, 2013)
The only other change to it was made by Clemens drizzd ( drizzd ), which obliged af65f68 (November 16, 2015) to ignore SIGPIPE , i.e. to ignore its standard input stream. (Combined by Jeff King - peff - in commit 40fdcc5 , December 01, 2015)
The documentation includes :
Information about what to push is provided on the standard input of the trap in the form of lines:
<local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF
For example, if the + git push origin master:foreign + command was run, the trap would get a line similar to the following:
refs/heads/master 67890 refs/heads/foreign 12345
although full 40-character SHA1s will be provided.
- If the external ref does not exist yet,
<remote SHA1> will be 40 0 . - If the link should be removed,
<local ref> will be provided as (delete) and <local SHA1> will be 40 0 .
To determine the correct value for the remote SHA1, the transport.c file must communicate with the remote repository (in your case GitLab)