You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will initialize a new Git repo in the current directory with 2 branches, each containing 10 commits.
12
+
This will initialize a new Git repo in the current directory with 4 branches, each containing 10 commits, 1 of which is merged back into `main`.
13
13
14
-
Note: All generated dummy repos have at minimum 1 branch called `main`. For dummies with multiple branches, branches are named `branch1, branch2, ..., branchN`. Each branch currently branches off of `main` at `--diverge-at` if supplied, or else a randomly chosen commit. The length of each branch is capped at the number of commits specified by `--commits`.
14
+
Note: All generated dummy repos have at minimum 1 branch called `main`. For dummies with multiple branches, branches are named `branch1, branch2, ..., branchN`. Each branch currently branches off of `main` at `--diverge-at` if 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,...,n` to select which branches get merged back into `main`.
15
15
16
16
## Use cases
17
17
- Programatically generate Git repos for functional testing of Git tools
18
18
- Decide how many commits and branches are generated
19
+
- Select which branches get merged back into `main`
19
20
- Mimic scenarios in real Git repos to practice on without touching real data
20
21
- Generate Git demo repos to teach or learn from
21
22
22
23
## Features
23
24
- Run a one-liner git-dummy command in the terminal to generate a dummy Git repo based on your parameters
24
-
- Customize the repo name, path, number of commits, branches, and structure
25
+
- Customize the repo name, path, number of commits, branches, merges, and structure
25
26
26
27
## Quickstart
27
28
@@ -61,7 +62,8 @@ Available options and flags include:
61
62
`--name`: The name of the dummy Git repo, defaults to "dummy".
62
63
`--commits`: The number of commits to populate in the dummy Git repo, defaults to 5.
63
64
`--branches`: The number of branches to generate in the dummy Git repo, defaults to 1.
64
-
`--diverge-at`: The commit number at which branches diverge from `main`.
65
+
`--diverge-at`: The commit number at which branches diverge from `main`.
66
+
`--merge`: A comma separated list of branch postfix ids to merge back into `main`.
65
67
`--git-dir`: The path at which to store the dummy Git repo, defaults to current directory.
66
68
67
69
## Command examples
@@ -77,6 +79,12 @@ Generate a dummy repo with 4 branches `main`, `branch1`, `branch2`, and `branch3
77
79
$ git-dummy --branches=4 --diverge-at=2
78
80
```
79
81
82
+
Generate a dummy repo with 4 branches, so that `branch1` and `branch3` are merged back into `main`:
83
+
84
+
```console
85
+
$ git-dummy --branches=4 --merge=1,3
86
+
```
87
+
80
88
For convenience, environment variables can be set for any command-line option available in git-dummy. All environment variables start with `git_dummy_` followed by the name of the option.
81
89
82
90
For example, the `--git-dir` option can be set as an environment variable like:
0 commit comments