gpt4 book ai didi

git - 如何确定 git 子模块实际上是在其远程模块之前还是之后?

转载 作者:太空狗 更新时间:2023-10-29 13:47:12 24 4
gpt4 key购买 nike

我确实找到了一个在某种程度上回答了这个问题的老问题,但就目前而言它并不完全有用:

how can I find out if a git submodule has new commits

主要是我希望 git 自 2012 年以来已经发生了足够大的变化,以至于这更容易。

当我执行 git status 时使用我当前的设置,我得到两种类型的输出。常规线路

modified: path/to/submodule (new commits)

还有一些关于像这样的子模块的额外信息

* path/to/submodule/
< upstream repo
< added more commits
< you should update this submodule

* path/to/submodule/
> These commits
> don't exist upstream
> you should commit this submodule

Git 似乎确切地知道发生了什么,但我似乎没有自己确定的工具。

我的目标是了解每个子模块是否应该提交、更新或手动调查,因为混合了 ><在那里。我正准备编写一个基于启发式的脚本,感觉很糟糕,因此非常感谢收到更好的想法。

$ git --version
git version 1.8.5.3

最佳答案

你可以尝试,从父仓库:

git config status.submodulesummary -1
git status --long

那应该显示尚未推送到子模块的子模块的任何提交 upstream repo .

关于git - 如何确定 git 子模块实际上是在其远程模块之前还是之后?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22402865/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com