SourceTree 中的 git 子模块更新在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12899163/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 14:46:48  来源:igfitidea点击:

Where is git submodule update in SourceTree?

gitgit-guiatlassian-sourcetree

提问by artistoex

How can I update git sub modules in SourceTree?

如何更新 SourceTree 中的 git 子模块?

回答by edmengel

I couldn't find the answer myself, so I created a custom action. Go to Preferences, Custom Actions, and enter the following info: (This is on a Mac. Your path to the git executable may vary.) git submodule update custom action

我自己找不到答案,所以我创建了一个自定义操作。转到首选项、自定义操作,然后输入以下信息:(这是在 Mac 上。您的 git 可执行文件路径可能会有所不同。) git 子模块更新自定义操作

回答by Raymond Chenon

Just double-click on the submodule or left-click and open the module enter image description here

只需双击子模块或左键单击并打开模块 在此处输入图片说明

Once in the submodule, the UI is like any git repo , press on pull/fetch to update to the header. And voila.

进入子模块后,UI 就像任何 git repo 一样,按下 pull/fetch 以更新到标题。瞧。

回答by dtmland

Here is the windowsversion:

这是windows版本:

enter image description here

在此处输入图片说明

This command assumes the location of your sh.exe- depending on how you setup SourceTree it could be somewhere else.

此命令假定您的位置sh.exe- 取决于您如何设置 SourceTree,它可能位于其他位置。

/c %LOCALAPPDATA%\Atlassian\SourceTree\git_local\bin\sh.exe --login -i -c "git submodule update"""

Not sure whether it is a bug - but in the version of Sourcetree I am using (v1.6.14.0) I found that having the extra pair of quotations ""on the end was required - otherwise an extra quotation exists and the unbalanced statement then causes shto bark:

不确定这是否是一个错误 - 但在我使用的 Sourcetree 版本(v1.6.14.0)中,我发现""需要在末尾添加一对额外的引号- 否则存在额外的引号并且不平衡的语句会导致sh大叫:

cmd "/c %LOCALAPPDATA%\Atlassian\SourceTree\git_local\bin\sh.exe --login -i -c "git submodule update""
sh: unexpected EOF while looking for matching `"'
sh: syntax error: unexpected end of file

Completed with errors, see above.

回答by CharlieBird

The linkprovided by Isuru does include how to perform update (look for "Change the submodule commit which your repository is tracking")

Isuru 提供的链接确实包括如何执行更新(查找“更改存储库正在跟踪的子模块提交”)

In short, on the main repository,

简而言之,在主存储库上,

  • choose the submodules dropdown
  • double click the submodule you want to update - you will switch focus to the submodule
  • pull (latest) or checkout (specific commit) the required update
  • go back to the tab for the main repository
  • there will be an uncommitted change (which submodule commit to use) in the main repository
  • commit and push the change
  • 选择子模块下拉菜单
  • 双击要更新的子模块 - 您将焦点切换到子模块
  • 拉(最新)或签出(特定提交)所需的更新
  • 返回主存储库的选项卡
  • 主存储库中将有一个未提交的更改(提交使用哪个子模块)
  • 提交并推送更改