git port - network requirement

2019-06-07 07:53发布

问题:

While connected to my office network, I always not be able to run git push. It seems there is network setting issue. Any advice how to troubleshoot the issue or what request shall I convey to network team?

回答1:

You can try running with a couple options set:

$ GIT_TRACE=2 git push

This will cause extra debugging information to be emitted and may be useful. If you're using an HTTP connection to your repository, you could try:

$ GIT_CURL_VERBOSE=1 git push

Or, you can use GIT_TRACE_PACKET to get more information about the on-the-wire transfer:

$ GIT_TRACE_PACKET=1 git push

It will stop tracing packets once it sees a pack transfer starting, but it may help provide more information about the underlying cause.

You can combine the options as well. This is probably the most useful invocation to start with:

$ GIT_TRACE=2 GIT_TRACE_PACKET=1 git push


回答2:

Git 2.6+ (Q3 2015) will propose an extension to the existing GIT_TRACE_PACKET debugging option.

See commit 3235983 (16 Jun 2015), and commit d6d1a75, commit f3612ac (12 Jun 2015) by Jeff King (peff).
(Merged by Junio C Hamano -- gitster -- in commit 0b9ce18, 03 Aug 2015)

pkt-line: support tracing verbatim pack contents

When debugging the pack protocol, it is sometimes useful to store the verbatim pack that we sent or received on the wire. Looking at the on-disk result is often not helpful for a few reasons:

  1. If the operation is a clone, we destroy the repo on failure, leaving nothing on disk.
  2. If the pack is small, we unpack it immediately, and the full pack never hits the disk.
  3. If we feed the pack to "index-pack --fix-thin", the resulting pack has the extra delta bases added to it.

We already have a GIT_TRACE_PACKET mechanism for tracing packets.
Let's extend it with GIT_TRACE_PACKFILE to dump the verbatim packfile.