Skip to content

saswatamcode/submoduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

submoduler

Note

This entire Go module was generated by Google's Gemini AI initially. While it has been tested/reviewed for the described functionality, it may still contain unexpected behaviors. Use with discretion.

A simple, zero-dep robust command-line tool for updating Git submodules with ease.

submoduler is a smart utility that handles the common pain points of managing Git submodules. It ensures your submodules are initialized, fetches the latest changes, and updates them either to their latest tracked commit or to a specific commit, tag, or branch you define.

Features

  • Automatic Initialization: Clones and initializes any missing submodules before starting.

  • Safe Default Updates: Updates submodules to the latest commit on their tracked remote branch, correctly handling "detached HEAD" states.

  • Specific Version Pinning: Easily check out a specific commit hash, release tag, or branch for any submodule.

  • Cloning Progress: Shows real-time progress when cloning new submodules.

  • Verbose Output: Optional -v flag to see the underlying Git commands being executed.

Installation

Ensure you have Go installed and your $GOPATH/bin (or $HOME/go/bin) is in your system's PATH.

go install github.com/saswatamcode/submoduler@latest

Usage

Run the tool from the root directory of your Git repository.

submoduler [flags] [submodule1=ref] [submodule2=ref] ...

Options

  • -v: Enable verbose mode to show all Git commands being run.

Arguments

  • [submodule_path=ref] (Optional): Specify a target for one or more submodules.

    • submodule_path: The relative path to the submodule.

    • ref: The Git reference to check out (can be a commit hash, tag, or branch name).

If no arguments are provided, submoduler will update all submodules to the latest commit on their respective tracked branches.

Examples

1. Update all submodules to their latest versions:

submoduler

2. Update a specific submodule to a release tag:

submoduler path/to/my-lib=v2.5.1

3. Update multiple submodules to different refs:

submoduler libs/api=a1b2c3d4 common/utils=main

4. Update all submodules with verbose output:

submoduler -v

About

Zero-dep tool to update submodules easily

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages