Sublime Forum

How to do recursive submodule update

#1

How do you update all submodules recursively in Sublime Merge?
In git command I would do this: “git submodule update --recursive”.

I have had a look at this topic but didn’t find an answer or maybe didn’t understood it.

0 Likes

#2

There isn’t a straightforward way to add functionality to Sublime Merge yet, the topic you linked shows how to add a command to the command palette, here are a bit more detailed instructions:

Your customizations will reside in the User folder found when choosing the menu item Preferences > Browse Packages....

Option 1: menu item in Submodules right click menu in the location bar

Create the file Submodule Section.sublime-menu in the above User folder with the contents:

[
	{ "caption": "-", "id": "end" },
	{
		"caption": "Update All Submodules Recursively",
		"command": "git",
		"args": {"argv": ["submodule", "update", "--recursive"]}
	}
]

Option 2: keyboard shortcut

Create the file Default.sublime-keymap in the above User folder with the contents:

[
	{
		"keys": "ctrl+alt+shift+u",
		"command": "git",
		"args": {"argv": ["submodule", "update", "--recursive"]}
	}
]

Option 3: command palette entry

Create the file Default.sublime-commands in the above User folder with the contents:

[
	{
		"caption": "Update All Submodules Recursively",
		"command": "git",
		"args": {"argv": ["submodule", "update", "--recursive"]}
	}
]
1 Like

#3

I also added the --init flag to the command so that it can init all submodules recursively once the repo is cloned. I believe it has no effect after the submodules haven’t been initialised.

0 Likes