Skip to content

Instantly share code, notes, and snippets.

@andry81
Last active January 16, 2026 03:39
Show Gist options
  • Select an option

  • Save andry81/b0000d2ddfa890f7ac68f1cabb6c1978 to your computer and use it in GitHub Desktop.

Select an option

Save andry81/b0000d2ddfa890f7ac68f1cabb6c1978 to your computer and use it in GitHub Desktop.
Git modules experience
  • git_modules_experience.md
  • 2026.01.16
  1. DESCRIPTION
  2. INVESTIGATION
  3. CONSLUSION
  4. USAGE
  5. RELATED ISSUES

  1. DESCRIPTION

Git modules experience.


  1. INVESTIGATION

kernel.org:

kde.org:

Github:

Stackoverflow:

SVN-to-Git translation related tools:

Git related tools:


  1. CONSLUSION

Seems vcstool (or probably another name related to a fork you are chosen) and forks is the best choice here to avoid .gitmodules file in first place.

Note

There is always be forks that has ahead commits with new functionality or even a standalone development. You have to investigate on your own to find the best variant.

Note

Some forks may does not exist as forks, so you won't find them using a fork related tree search. The only way to find is to use a broad Git search using keywords. See for details: Forks trace or filtering is broken (forks segmentation) : https://github.com/orgs/community/discussions/173970

Note

Original repository: https://github.com/dirk-thomas/vcstool

Discussion: Status of vcstool : dirk-thomas/vcstool#242

On another hand the .gitmodules file might be required in some circumstances and it's presence (and vcstool file too as well if hashes are used) in the default branch is not preferred, because will interfere with source files commits and may be left in the desync state because of a rewrite in a submodule, which will require a rewrite in all dependent repositories and basically is pain in arse. So better just push the .gitmodules file out of a default branch into standalone branch where you can rewrite without affecting the sources.

For example, use master branch to store sources without submodules and master-modules (or master-all) branch to store sources plus .gitmodules file to checkout default branch with head submodules or with freezed submodules. Later you can just rewrite master-modules without affecting the source files from master (there won't be merges from master-modules to master, only from master into master-modules).

This approach can use both the vcstool as a more convenient tool by default and the .gitmodules file, where it is might be required because of circumstances. For example, for a ZIP archive (Download ZIP button) as were noted here.


  1. USAGE

https://github.com/andry81/externals


  1. RELATED ISSUES

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment