What's the Git command to determine which commit changed a submodule pointer?

ぐ巨炮叔叔 提交于 2019-12-04 06:51:19

From what I can tell this isn't quite possible, the closest you can get is to determine which commits added or removed that particular submodule pointer:

git log -p -S "Subproject commit c4965b1..."

yields:

commit xyz123456
Author:
Date:

    Message

diff...
@@ -1 +1 @@
-Subproject commit 901231290321
+Subproject commit 1902u8129039

The only thing is +/- are not part of the actual string you're searching for, so you can't look for an addition or removal specifically, but using the -p flag will let you see this easily.

You can also use

git log -p -- path/to/submodule

to see all commits that have updated your submodule pointer if you want to see how it changed over time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!