summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-06 04:05:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-06 04:05:34 +0000
commit2a5c4df5436696d8656c0a630dcaf1dea9e828ea (patch)
tree83f406ee5035fc5c284274699943ed5fccc6a852 /README.md
parentAdding upstream version 0.15.2. (diff)
downloadgita-2a5c4df5436696d8656c0a630dcaf1dea9e828ea.tar.xz
gita-2a5c4df5436696d8656c0a630dcaf1dea9e828ea.zip
Adding upstream version 0.15.7.upstream/0.15.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'README.md')
-rw-r--r--README.md73
1 files changed, 33 insertions, 40 deletions
diff --git a/README.md b/README.md
index f18294e..478c432 100644
--- a/README.md
+++ b/README.md
@@ -57,9 +57,11 @@ See the [customization section](#custom).
The additional status symbols denote
-- `+`: staged changes
-- `*`: unstaged changes
-- `_`: untracked files/folders
+symbol | meaning
+---|---
+ `+`| staged changes
+ `*`| unstaged changes
+ `_`| untracked files/folders
The bookkeeping sub-commands are
@@ -67,21 +69,22 @@ The bookkeeping sub-commands are
- `gita add -a <repo-parent-path(s)>`: add repo(s) in <repo-parent-path(s)> recursively
and automatically generate hierarchical groups. See the [customization section](#custom) for more details.
- `gita add -b <bare-repo-path(s)>`: add bare repo(s) to `gita`. See the [customization section](#custom) for more details on setting custom worktree.
-- `gita add -m <main-repo-path(s)>`: add main repo(s) to `gita`. See the [customization section](#custom) for more details.
- `gita add -r <repo-parent-path(s)>`: add repo(s) in <repo-parent-path(s)> recursively
- `gita clone <config-file>`: clone repos in `config-file` (generated by `gita freeze`) to current directory.
- `gita clone -p <config-file>`: clone repos in `config-file` to prescribed paths.
- `gita context`: context sub-command
- `gita context`: show current context
- - `gita context none`: remove context
- `gita context <group-name>`: set context to `group-name`, all operations then only apply to repos in this group
+ - `gita context auto`: set context automatically according to the current working directory
+ - `gita context none`: remove context
- `gita color`: color sub-command
- `gita color [ll]`: Show available colors and the current coloring scheme
- `gita color set <situation> <color>`: Use the specified color for the local-remote situation
- `gita flags`: flags sub-command
- `gita flags set <repo-name> <flags>`: add custom `flags` to repo
- `gita flags [ll]`: display repos with custom flags
-- `gita freeze`: print information of all repos such as URL, name, and path.
+- `gita freeze`: print information of all repos such as URL, name, and path. Use with
+ `gita clone`.
- `gita group`: group sub-command
- `gita group add <repo-name(s)> -n <group-name>`: add repo(s) to a new or existing group
- `gita group [ll]`: display existing groups with repos
@@ -95,6 +98,7 @@ The bookkeeping sub-commands are
- `gita info rm <info-item>`: disable information item
- `gita ll`: display the status of all repos
- `gita ll <group-name>`: display the status of repos in a group
+- `gita ll -g`: display the repo summaries by groups
- `gita ls`: display the names of all repos
- `gita ls <repo-name>`: display the absolute path of one repo
- `gita rename <repo-name> <new-name>`: rename a repo
@@ -211,6 +215,20 @@ gita ll
gita pull
```
+The most useful context maybe `auto`.
+In this mode, the context is automatically determined from the
+current working directory (CWD): the context is the group whose member repo's
+path contains CWD. To set it, run
+
+```
+gita context auto
+```
+
+To remove the context, run
+```
+gita context none
+```
+
It is also possible to recursively add repos within a directory and
generate hierarchical groups automatically. For example, running
@@ -229,41 +247,13 @@ src
│   └── repo5
└── repo6
```
-gives rise to
+gives rise to 3 groups:
```
src:repo1,repo2,repo3,repo4,repo5,repo6
src-project1:repo1,repo2
src-project2:repo4,repo5
```
-
-### define main repos and shadow the global configuration setting with local setting
-
-The so-called main repos contain `.gita` folder for local configurations.
-It works best for the repos-within-repo project structure, for example,
-
-```
-main-repo
-├── sub-repo1
-│   └── sub-sub-repo
-├── sub-repo2
-└── sub-repo3
-```
-
-When executing `gita` commands within/relative to a main repo, local configurations
-are used. And only repos within the current main repos are in the scope.
-
-To add a main repo, run
-
-```
-gita add -m main-repo-path
-```
-
-Subordinate repos are added recursively to the local configuration.
-Only the main repo is saved to the global configuration.
-
-In the `gita ll` display, the main repos are underlined.
-
### add user-defined sub-command using json file
Custom delegating sub-commands can be defined in `$XDG_CONFIG_HOME/gita/cmds.json`
@@ -341,21 +331,24 @@ branch,commit_msg,commit_time
### customize git command flags
-One can set custom flags to run `git` commands. For example
+One can set custom flags to run `git` commands. For example, with
```
-gita flags set my-repo --git-dir=$HOME/somefolder --work-tree=$HOME
+gita flags set my-repo --git-dir=`gita ls dotfiles` --work-tree=$HOME
```
-Then any `git` command/alias triggered from `gita` on `my-repo` will use these flags.
+any `git` command/alias triggered from `gita` on `dotfiles` will use these flags.
Note that the flags are applied immediately after `git`. For example,
-`gita st my-repo` translates to
+`gita st dotfiles` translates to
```
git --git-dir=$HOME/somefolder --work-tree=$HOME status
```
-running from the `my-repo` directory.
+running from the `dotfiles` directory.
+
+This feature was originally added to deal with
+[bare repo dotfiles](https://www.atlassian.com/git/tutorials/dotfiles).
## Requirements