Description
git-trees
is a Git port of the Mercurial extension trees. git-trees
helps manage a set of loosely couple Git repositories in a uniform way - commands can in a convenient way be run in multiple nested Git repositories. git-trees
will automatically discover any nested Git repositories upon first use, there is no need to configure anything. If eventual nested repositories changes then a user must run git trees treconfigure
in order for git-trees to pick up the new hierarchy.
Usage
Code Block |
---|
|
$ git trees -h
usage: git-trees [options] <COMMAND> [<ARGS>]
<COMMAND> A git/hg command to run once for each repo, or
treconfigure to pick up changes in the tree hierarchy
-m, --mercurial Deprecated: force use of mercurial
-h, --help Show this help text
--version Print the version of this tool |
Examples
Running the command status --short
in the top-level repository and a nested repository:
Code Block |
---|
|
$ git trees status --short
[/home/user/git/top-level]
M README.md
[/home/user/git/top-level/nested]
M CONTRIBUTING.md |
Configuration
It is common to alias existing command prefixed with "t" for running the equivalent command in the top-level repository and all nested repositories. The following sets up the alias tstatus
for the command trees status:
Code Block |
---|
|
$ git config --global alias.tstatus 'trees status' |
Skara's gitconfig file comes with a number of aliases defined for the most common Git commands.
Source
See GitTrees.java.