git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's partial clone and sparse checkout features.

Overview

Partial Submodules for Git

git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's partial clone and sparse checkout features.

In top-level repositories, git provides various partial-clone options such as "blobless" clone, which reduce the burden of downloading large repositories. For submodules, only "shallow" clones are supported by git, but shallow clones have usability issues that make the resulting repo difficult to work with. git-partial-submodule clones your submodules as blobless repos, leaving them fully functional while saving bandwidth and disk space compared to a full clone.

Similarly, top-level repositories support sparse checkout, which lets you cut down the worktree to just the files you're interested in. This is particularly relevant for submodules, as their repositories often contain extra contents such as tests, examples, ancillary tools, and suchlike that we don't need if we just want to use the submodule as a library in our project. git-partial-submodule stores sparse checkout patterns in .gitmodules, so they can be managed under version control and automatically applied when the submodules are cloned.

Prerequisites

  • git 2.27.0 or later
  • Python 3.8 or later

Installation

git-partial-submodule is a single-file Python script. Download the script and put it somewhere in your PATH, or add it to your repository. Or add this repository as a submodule.

Usage

git-partial-submodule.py add [-b BRANCH] [--name NAME] [--sparse] 
   
    
    
    
     
     
git-partial-submodule.py clone [
     
     
      
      ...]
git-partial-submodule.py save-sparse [
      
      
       
       ...]
git-partial-submodule.py restore-sparse [
       
       
         ...] 
       
      
      
     
     
    
    
   
   

Add

Creates and clones a new submodule, much like git submodule add, but performs a blobless clone. If --sparse is specified, also enables sparse checkout on the new submodule, with the default pattern set of /* !/*/.

Clone

Use this to initialize submodules after a fresh clone of the superproject. Performs blobless clones of any submodules that are not already cloned. Also applies any sparse checkout patterns specified in .gitmodules.

Save-Sparse

After making changes to the sparse patterns in a submodule, use this to save them to .gitmodules. Patterns are stored space-delimited in the sparse-checkout property.

Restore-Sparse

Reapplies the sparse patterns saved in .gitmodules to the actual submodules. Use this after pulling or switching branches, etc.

Limitations and Cautions

Partial clone and sparse checkout are both still experimental git features that may have sharp edges.

This tool works by fiddling with the internals of your repository in not-officially-supported ways, so it might fail or do the wrong thing in some edge cases I haven't considered (and might leave your repo in a bad state afterward).

Not all of the various command-line options to the underlying git clone, git submodule add, etc. are supported. In particular, recursive clone is not currently supported.

"Cone" mode for sparse checkout is not currently supported.

Spaces in sparse checkout patterns are not currently handled correctly.

Owner
Nathan Reed
3D rendering at Adobe; formerly at 343, Sucker Punch, and NVIDIA. Math & coding blog writer, sometime musician, sci-fi & physics nerd. He/him.
Nathan Reed
Animefetch is an anime command-line system information tool written in python

Animefetch - v0.0.3 An anime command-line system information tool written in python. Description Animefetch is an anime command-line system informatio

Thadeuks 6 Jun 17, 2022
Tncli - TON smart contract command line interface

Tncli TON smart contract command line interface State Not working, in active dev

Disintar IO 100 Dec 18, 2022
AutoSub is a CLI application to generate subtitle files (.srt, .vtt, and .txt transcript) for any video file using Mozilla DeepSpeech.

AutoSub About Motivation Installation Docker How-to example How it works TO-DO Contributing References About AutoSub is a CLI application to generate

Abhiroop Talasila 414 Jan 06, 2023
A python-based terminal application that displays current cryptocurrency prices

CryptoAssetPrices A python-based terminal application that displays current cryptocurrency prices. Covered Cryptocurrencies Bitcoin (BTC) Ethereum (ET

3 Apr 21, 2022
Wordle for CLUE - WORDLE clone for Adafruit Clue

Wordle_for_CLUE This project is a clone of the very popular word solving puzzle

Michael Lacock 4 Feb 15, 2022
CLI utility for updating the EVE Online static data export in a postgres database

EVE SDE Postgres updater CLI utility for updating the EVE Online static data export postgres database. This has been tested with the Fuzzwork postgres

Markus Juopperi 1 Oct 29, 2021
AthenaCLI is a CLI tool for AWS Athena service that can do auto-completion and syntax highlighting.

Introduction AthenaCLI is a command line interface (CLI) for the Athena service that can do auto-completion and syntax highlighting, and is a proud me

dbcli 192 Jan 07, 2023
Cli tool to browse and play anime

browse and watch anime (scrape from gogoanime) (wip) basically ani-cli but in python cuz python good demo dependencies mpv installation from pypi pip

sheep padowo 2 Apr 20, 2022
Features terminal for python

Features Terminal V1.0 (23/10/2021) Um programa para linux com diferentes ferramentas! Recursos: Criador de QR code Gerador de senhas Teste de velocid

1 Oct 26, 2021
A simple python application for running a CI pipeline locally

A simple python application for running a CI pipeline locally This app currently supports GitLab CI scripts

Tom Stowe 0 Jan 11, 2022
Yts-cli-streamer - A CLI movie streaming client which works on yts.mx API written in python

YTSP It is a CLI movie streaming client which works on yts.mx API written in pyt

1 Feb 05, 2022
A terminal UI dashboard to monitor requests for code review across Github and Gitlab repositories.

A terminal UI dashboard to monitor requests for code review across Github and Gitlab repositories.

Kyle Harrison 150 Dec 14, 2022
Centauro - a command line tool with some network management functionality

Centauro Ferramenta de rede O Centauro Γ© uma ferramenta de linha de comando com

1 Jan 01, 2022
xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.

xonsh xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt. The language is a superset of Python 3.6+ with additio

xonsh 6.7k Jan 08, 2023
A startpage configured aesthetically with terminal-esque link formatting

Terminal-y Startpage Setup Clone the repository, then make an unformatted.txt file following the specifications in example.txt. Run format.py Open ind

belkarx 13 May 01, 2022
GitFun - A Simplified Automated CLI tool for GITπŸ˜ƒ

GitFun A Simplified Automated CLI tool for GIT, It's for Lazy Developers and Newbies 😜 Table of contents GitFun Installation Usage Development Contri

Astaqc 8 Feb 22, 2022
Command line client for Audience Insights

Dynamics 365 Audience Insights CLI The AuI CLI is a command line tool for Dynamics 365 Audience Insights. It is based on the customerinsights Python l

Microsoft 8 Jan 09, 2023
Command line interface for testing internet bandwidth using speedtest.net

speedtest-cli Command line interface for testing internet bandwidth using speedtest.net Versions speedtest-cli works with Python 2.4-3.7 Installation

Matt Martz 12.4k Jan 08, 2023
πŸ’₯ Share files easily over your local network from the terminal!

Fileshare πŸ“¨ Share files easily over your local network from the terminal! πŸ“¨ Installation # clone the repo $ git clone https://github.com/dopevog/fil

Dopevog 11 Sep 10, 2021
Bear-Shell is a shell based in the terminal or command prompt.

Bear-Shell is a shell based in the terminal or command prompt. You can navigate files, run python files, create files via the BearUtils text editor, and a lot more coming up!

MichaelBear 6 Dec 25, 2021