From 2a5c4df5436696d8656c0a630dcaf1dea9e828ea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 Sep 2021 06:05:34 +0200 Subject: Adding upstream version 0.15.7. Signed-off-by: Daniel Baumann --- README.md | 73 +++++++++++++++++++++++++++++---------------------------------- 1 file changed, 33 insertions(+), 40 deletions(-) (limited to 'README.md') 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 `: add repo(s) in recursively and automatically generate hierarchical groups. See the [customization section](#custom) for more details. - `gita add -b `: add bare repo(s) to `gita`. See the [customization section](#custom) for more details on setting custom worktree. -- `gita add -m `: add main repo(s) to `gita`. See the [customization section](#custom) for more details. - `gita add -r `: add repo(s) in recursively - `gita clone `: clone repos in `config-file` (generated by `gita freeze`) to current directory. - `gita clone -p `: 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 `: 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 `: Use the specified color for the local-remote situation - `gita flags`: flags sub-command - `gita flags set `: 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 -n `: 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 `: disable information item - `gita ll`: display the status of all repos - `gita ll `: 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 `: display the absolute path of one repo - `gita rename `: 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 -- cgit v1.2.3