Package: git-dummy
git-dummyGenerate dummy Git repositories and populate them with the desired number of commits, branches, merges, and structure.Example:$ git-dummy --commits=10 --branches=4 --merge=1This will initialize a new Git repo in the current directory with 4 branches, each containing 10 commits, 1 of which is merged back intomain.Note: All generated dummy repos have at minimum 1 branch calledmain. For dummies with multiple branches, branches are namedbranch1, branch2, ..., branchN. Each branch currently branches off ofmainat--diverge-atif supplied, or else a randomly chosen commit. The length of each branch is capped at the number of commits specified by--commits. Use--merge=x,y,...,nto select which branches get merged back intomain.Use casesProgramatically generate Git repos for functional testing of Git toolsDecide how many commits and branches are generatedSelect which branches get merged back intomainMimic scenarios in real Git repos to practice on without touching real dataGenerate Git demo repos to teach or learn fromFeaturesRun a one-liner git-dummy command in the terminal to generate a dummy Git repo based on your parametersCustomize the repo name, path, number of commits, branches, merges, and structureQuickstartInstallgit-dummy:$pipinstallgit-dummyBrowse to the directory you want to create your dummy Git repo in:$cdpath/to/dummy/parentRun the program:$git-dummy[options]A new Git repo calleddummywill be initialized and populated based on the supplied parameters.See global help for list of global options/flags and subcommands:$git-dummy-hRequirementsPython 3.7 or greaterPip (Package manager for Python)Command options and flagsAvailable options and flags include:--name: The name of the dummy Git repo, defaults to "dummy".--commits: The number of commits to populate in the dummy Git repo, defaults to 5.--branches: The number of branches to generate in the dummy Git repo, defaults to 1.--diverge-at: The commit number at which branches diverge frommain.--merge: A comma separated list of branch postfix ids to merge back intomain.--git-dir: The path at which to store the dummy Git repo, defaults to current directory.--no-subdir: Initialize the dummy Git repo in the current directory instead of in a subdirectory.--constant_sha: Use constant values for commit author, email, and commit date parameters to yield consistent sha1 values across git-dummy runs.--allow-nested: Allow dummy repo creation within an existing Git repo, as long as it's not at the level of an existing .git/ folder.Command examplesGenerate a dummy Git repo called "cheese" on your Desktop, with 2 branches and 10 commits on each branch:$git-dummy--name=cheese--branches=2--commits=10--git-dir=~/DesktopGenerate a dummy repo with 4 branchesmain,branch1,branch2, andbranch3. Branches diverge frommainafter the 2nd commit:$git-dummy--branches=4--diverge-at=2Generate a dummy repo with 4 branches, so thatbranch1andbranch3are merged back intomain:$git-dummy--branches=4--merge=1,3For convenience, environment variables can be set for any command-line option available in git-dummy. All environment variables start withgit_dummy_followed by the name of the option.For example, the--git-diroption can be set as an environment variable like:$exportgit_dummy_git_dir=~/DesktopSimilarly, the--nameoption can be set like:$exportgit_dummy_name=cheeseIn general:$exportgit_dummy_option_name=option_valueExplicitly specifying options at the command-line takes precedence over the corresponding environment variable values.Learn MoreLearn more about this tool on thegit-dummy project page.AuthorsJacob Stopak- on behalf ofInitial Commit