Git - pushing a remote branch for a large project is really slow

后端 未结 2 1084
时光说笑
时光说笑 2020-12-30 04:24

We\'re just moving to git at my work. We have a reasonably large project with some fairly large resources under version control (~500MB).

Today we tried to push a br

2条回答
  •  天命终不由人
    2020-12-30 05:23

    Another factor can explain the git push poor performance:

    "git push" used to check ambiguities between object-names and refnames while processing the list of refs' old and new values, which was unnecessary (as it knew that it is feeding raw object names).

    See commit a4544b3 (06 Nov 2018) by Derrick Stolee (derrickstolee).
    Helped-by: Jeff King (peff).
    (Merged by Junio C Hamano -- gitster -- in commit 1373999, 19 Nov 2018)

    pack-objects: ignore ambiguous object warnings

    A git push process runs several processes during its run, but one includes git send-pack which calls git pack-objects and passes the known have/wants into stdin using object ids.

    However, the default setting for core.warnAmbiguousRefs requires git pack-objects to check for ref names matching the ref_rev_parse_rules array in refs.c.
    This means that every object is triggering at least six "file exists?" queries.

    When there are a lot of refs, this can add up significantly!
    I observed a simple push spending three seconds checking these paths.

    This has been fixed with Git 2.20 (Q4 2018).

提交回复
热议问题