如何知道是否已将git子模块提交推送到存储库中 [英] How to know if a git submodule commit is already pushed into the repository

查看:69
本文介绍了如何知道是否已将git子模块提交推送到存储库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您有一个名为super的存储库和一个名为sub的子模块.站在超级位置,我想知道子提交是否已经被推送到存储库中,或者它是否是本地的.

Suppose you have a repository called super and a submodule called sub. Stand in super, I'd like to know if sub last commit is already pushed to the repository or if it's local.

推荐答案

在超级目录中,如果本地子目录的提交点与本地子目录的提交点不同,则"git status"将向您显示修改:submodule/sub(新提交)".本地超级的已提交子模块.

At super> "git status" will show you "modified: submodule/sub (new commits)" if the local sub is at a different commit point than the local super's committed submodule.

在sub>上,"git log origin/master..master"将显示您从推送的"master"分支和本地"master"分支(如果有)进行提交.

At sub> "git log origin/master..master" will show you commits from the pushed 'master' branch and local 'master' branch, if any.

这能回答您的问题吗?如果没有,请澄清.

Does this answer your question? If not, please clarify.

这篇关于如何知道是否已将git子模块提交推送到存储库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆