syhsyh9696
V2EX  ›  问与答

遇见这种 Git 警告应该怎么解决?

  •  
  •   syhsyh9696 · Jul 6, 2022 · 2219 views
    This topic created in 1412 days ago, the information mentioned may be changed or developed.

    每次在 git push 的时候都会报这样的 warning (Push 和 Pull 都不受影响)

    warning: ignoring broken ref refs/pull-requests/81/v2
    warning: ignoring broken ref refs/pull-requests/84/v1
    warning: ignoring broken ref refs/pull-requests/91/v1
    warning: ignoring broken ref refs/pull-requests/95/v3
    warning: ignoring broken ref refs/pull-requests/98/v2
    Everything up-to-date
    

    我看了本地的 .git/refs/ 文件夹也没有找到 pull-requests 这个子文件夹
    大家有什么好方法可以清理一下这些已经失效的 ref(大概几百条)😩

    感激不尽

    5 replies    2022-07-07 10:19:44 +08:00
    syhsyh9696
        2
    syhsyh9696  
    OP
       Jul 6, 2022
    @br_wang 谢谢回答,这个我也尝试过了但是也会报一个 warning
    ```shell
    remote: warning: Deleting a non-existent ref.
    ```
    很奇怪,明明已经不存在了
    GeruzoniAnsasu
        3
    GeruzoniAnsasu  
       Jul 6, 2022
    试试 git-fsck
    ailer
        4
    ailer  
       Jul 6, 2022 via Android
    删掉,再克隆
    forcecharlie
        5
    forcecharlie  
       Jul 7, 2022
    cat .git/packed-refs 看看有没有
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   937 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 21:01 · PVG 05:01 · LAX 14:01 · JFK 17:01
    ♥ Do have faith in what you're doing.