Synchronize diverging branches with a main HEAD.
- to create a git worktree for each diverging branch
- to rebase each diverging branch onto a main HEAD when
- the main
HEAD
reference is changed - a main branch is rebased (at each step)
- a new commit is added to the main branch
- the main
- A diverging branch contains its specific implementation of the feature for that they are created.
- A main branch contains the modifications concerning the main topic or shared by diverging branches.
- Each diverging branch must contain an empty commit separating main commits from its ones.
- Diverging branches must not contain modifications of the files introduced by a main branch.
- If rebasing of a diverging branch onto the main one introduces conflicts, then they are resolved keeping a patch from a diverging branch.
- This tool is usefull for a project which diverges in a way it is interpreted, namely, it will pick up modifications of a main branch in a worktree without interrupting interpreting source code in its specific way.
- Follow the
unpath
tool installation flow. - Configure this tool.
- Enable this tool.
- Set the
dvgGit.divergingBranches
to a set of diverging branch names separated by the space character. - Set the
dvgGit.main
to a main branch name.
- If the
dvgGit.main
git config option is not set, then a value of theinit.defaultBranch
is considered a name of a main branch.
- Enter a git repository using the
cd
command. - Enter the nix shell using the
nix-shell
command. - Run the
init-dvg-git
command.
- The
git
tool must be available in the nix shell in which the command is executed. - The
nix-shell
command must be executed either from a dependee root directory or with a path to either it or theshell.nix
file supplied. - The
nix-shell
command must be executed without the--pure
flag.
- Set up a workspace.
- Work as usual.
- Enter a main git repository using the
cd
command. - Open a separate terminal instance
for each created git worktree and enter each one using the
cd
command.
- Names of created worktree directories are a name of a main repository
prefixed with a diverging branch name
from the
dvgGit.divergingBranches
git config option.
This tool follows the convention
followed by the bem
library.
the init-dvg-git
command flag and option descriptions
Flag or option | Default value | Description |
---|---|---|
-s , --separator |
- |
a git worktree name separator between diverging branch and git repository names |