Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is git submodule update in SourceTree?

How can I update git sub modules in SourceTree?

like image 591
wnrph Avatar asked Oct 15 '12 15:10

wnrph


People also ask

How do I update a submodule in SourceTree?

In SourceTree this is easy, just right-click on the submodule and select “Change Source URL”. You'll need to commit and push the change as normal, but after that your fork will be the source for the submodule.

How do I add a submodule in SourceTree?

1. Right-click the sidebar and select Add Submodule or Add/Link Subtree. 2. Click Repository at the top, and select Add Submodule or Add/Link Subtree.

Where is git submodule version stored?

It is stored in Git's object database directly. The tree object for the directory where the submodule lives will have an entry for the submodule's commit (this is the so-called "gitlink").


3 Answers

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

like image 169
edmengel Avatar answered Sep 27 '22 17:09

edmengel


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.

like image 43
Raymond Chenon Avatar answered Sep 27 '22 16:09

Raymond Chenon


Here is the windows 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.
like image 33
dtmland Avatar answered Sep 27 '22 17:09

dtmland