EnglishFrenchSpanish

OnWorks favicon

git-clone-subset - Online in the Cloud

Run git-clone-subset in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command git-clone-subset that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


git-clone-subset - Clones a subset of a git repository

SYNOPSIS


git-clone-subset [options] repository destination-dir pattern

DESCRIPTION


Clones a repository into a destination-dir and runs on the clone
git filter-branch --prune-empty --tree-filter 'git rm ...' -- --all
to prune from history all files except the ones matching pattern, effectively creating a
clone with a subset of files (and history) of the original repository.

Useful for creating a new repository out of a set of files from another repository,
migrating (only) their associated history. Very similar to what
git filter-branch --subdirectory-filter
does, but for a file pattern instead of just a single directory.

OPTIONS


-h, --help
show usage information.

repository
URL or local path to the git repository to be cloned.

destination-dir
Directory to create the clone. Same rules for git-clone applies: it will be
created if it does not exist and it must be empty otherwise. But, unlike git-
clone, this argument is not optional: git-clone uses several rules to determine
the "Humane" dir name of a cloned repo, and git-clone-subset will not risk parse
its output, let alone predict the chosen name.

pattern Glob pattern to match the desired files/dirs. It will be ultimately evaluated by a
call to bash, NOT git or sh, using extended glob '!(<pattern>)' rule. Quote it or
escape it on command line, so it does not get evaluated prematurely by your
current shell. Only a single pattern is allowed: if more are required, use
extglob's "|" syntax. Globs will be evaluated with bash's shopt dotglob set, so
beware. Patterns should not contain spaces or special chars like " ' $ ( ) { } `,
not even quoted or escaped, since that might interphere with the !() syntax after
pattern expansion.

Pattern Examples:

"*.png"
"*.png|*icon*"
"*.h|src/|lib"

LIMITATIONS


Renames are NOT followed. As a workaround, list the rename history with 'git log --follow
--name-status --format='%H' -- file | grep "^[RAD]"' and include all multiple names of a
file in the pattern, as in "currentname|oldname|initialname". As a side efect, if a
different file has taken place of an old name, it will be preserved too, and there is no
way around this using this tool.

There is no (easy) way to keep some files in a dir: using 'dir/foo*' as pattern will not
work. So keep the whole dir and remove files afterwards, using git filter-branch and a
(quite complex) combination of cloning, remote add, rebases, etc.

Pattern matching is quite limited, and many of bash's escaping and quoting does not work
properly when pattern is expanded inside !().

Use git-clone-subset online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    GenX
    GenX
    GenX is a scientific program to refine
    x-ray refelcetivity, neutron
    reflectivity and surface x-ray
    diffraction data using the differential
    evolution algorithm....
    Download GenX
  • 2
    pspp4windows
    pspp4windows
    PSPP is a program for statistical
    analysis of sampled data. It is a free
    replacement for the proprietary program
    SPSS. PSPP has both text-based and
    graphical us...
    Download pspp4windows
  • 3
    Git Extensions
    Git Extensions
    Git Extensions is a standalone UI tool
    for managing Git repositories. It also
    integrates with Windows Explorer and
    Microsoft Visual Studio
    (2015/2017/2019). Th...
    Download Git Extensions
  • 4
    eSpeak: speech synthesis
    eSpeak: speech synthesis
    Text to Speech engine for English and
    many other languages. Compact size with
    clear but artificial pronunciation.
    Available as a command-line program with
    many ...
    Download eSpeak: speech synthesis
  • 5
    Sky Chart / Cartes du Ciel
    Sky Chart / Cartes du Ciel
    SkyChart is a software to draw chart of
    the night sky for the amateur astronomer
    from a bunch of stars and nebulae
    catalogs. See main web page for full
    download...
    Download Sky Chart / Cartes du Ciel
  • 6
    GSmartControl
    GSmartControl
    GSmartControl is a graphical user
    interface for smartctl. It allows you to
    inspect the hard disk and solid-state
    drive SMART data to determine its
    health, as w...
    Download GSmartControl
  • More »

Linux commands

  • 1
    abc2abc
    abc2abc
    abc2abc - a simple abc
    checker/re-formatter/transposer ...
    Run abc2abc
  • 2
    abc2ly
    abc2ly
    abc2ly - manual page for abc2ly
    (LilyPond) 2.18.2 ...
    Run abc2ly
  • 3
    coqmktop
    coqmktop
    coqmktop - The Coq Proof Assistant
    user-tactics linker ...
    Run coqmktop
  • 4
    coqtop
    coqtop
    coqtop - The Coq Proof Assistant
    toplevel system ...
    Run coqtop
  • 5
    g.copygrass
    g.copygrass
    g.copy - Copies available data files in
    the current mapset search path to the
    user�s current mapset. KEYWORDS:
    general, map management ...
    Run g.copygrass
  • 6
    g.dirsepsgrass
    g.dirsepsgrass
    g.dirseps - Internal GRASS utility for
    converting directory separator
    characters. Converts any directory
    separator characters in the input string
    to or from na...
    Run g.dirsepsgrass
  • More »

Ad