Where is git submodule update in SourceTree?

2019-03-12 03:03发布

How can I update git sub modules in SourceTree?

5条回答
\"骚年 ilove
2楼-- · 2019-03-12 03:15

Here is the version:

enter image description here

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

/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 sh to bark:

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.
查看更多
唯我独甜
3楼-- · 2019-03-12 03:21

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.

查看更多
Deceive 欺骗
4楼-- · 2019-03-12 03:26

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

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
查看更多
叛逆
5楼-- · 2019-03-12 03:32

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

查看更多
相关推荐>>
6楼-- · 2019-03-12 03:34

SourceTree enables you to add submodules directly from the UI now. Simply right-click on the sidebar add choose 'Add Submodule' from the list. More info here.

查看更多
登录 后发表回答