With Git Parallel, several Git repositories can live inside a single directory.
Standard Generalized Markup Language (SGML) is a more complex precursor to the Extensible Markup Language (XML) commonly used nowadays. CONCUR was a feature of SGML that enabled parallel markup. Parallel markup allows the creation of documents that share data, such as the following two documents that capture the dramatic and metrical views of Ibsen's Peer Gynt:
<(V)line>
<(S)speech who="Åse">Peer, you're lying!</(S)speech>
<(S)speech who="Peer">No, I am not!</(S)speech>
</(V)line>
<(V)line>
<(S)speech who="Åse">Well then, swear that it is true!</(S)speech>
</(V)line>
<(V)line>
<(S)speech who="Peer">Swear? Why should I?</(S)speech>
<(S)speech who="Åse">See, you dare not!
</(V)line>
<(V)line>
It’s a lie from first to last.</(S)speech>
</(V)line>
Continuing in the same philosophy, Git Parallel is a tool that enables parallel Git repositories. Like the dramatic and metrical view of Ibsen's play, parallel Git repositories are also independent, but they share the same data (directory structure):
$ tree ~/data-repository
/home/pgynt/data-repository/
├── .git
├── posts
│ ├── 2019-09-16_aase-scolds-peer.md
│ ├── 2019-09-16_peer-confronts-smith.md
│ └── 2019-09-17_peer-meets-solveig.md
└── resources
├── aase-on-the-millhouse-roof.png
├── peer-among-the-wedding-guests.png
└── peer-before-the-king-of-trolls.png
$ tree ~/code-repository
/home/pgynt/code-repository/
├── Makefile
├── .git
└── resources
├── code.js
└── style.css
$ gp init
$ gp create --clone ~/data-repository master data
$ gp create --clone ~/code-repository master code
$ gp checkout code
$ tree
.
├── Makefile
├── .git
├── .gitparallel
│ ├── code -> ../git
│ └── data
├── posts
│ ├── 2019-09-16_aase-scolds-peer.md
│ ├── 2019-09-16_peer-confronts-smith.md
│ └── 2019-09-17_peer-meets-solveig.md
└── resources
├── aase-on-the-millhouse-roof.png
├── code.js
├── peer-among-the-wedding-guests.png
├── peer-before-the-king-of-trolls.png
└── style.css
- Bash 4+
- Git
flock
fromutil-linux
(optional)fmt
andreadlink
from GNU Coreutils (optional)
-
Copy the
gp
file into one of the directories in yourPATH
environment variable. -
To make Git-parallel accessible as a
git parallel
Git subcommand, copy thegit-parallel
file into one of the directories in yourPATH
variable. -
To enable Bash command completion for Git-parallel, the
gp.bash-completion
file needs to be sourced, when bash starts. You can do this at the system level by copying thegp.bash-completion
file into the/etc/bash-completion.d/
directory. You can also do this on a per-user basis by copying thegp.bash-completion
file to a directory/path/to/
, and then including a line such as the following in the user's~/.bashrc
configuration file:source /path/to/gp.bash-completion