From cef385bd449cb4506bbf27f481130d7ddd3c8780 Mon Sep 17 00:00:00 2001 From: Wenxuan Zhang Date: Fri, 22 Oct 2021 10:39:35 +0800 Subject: [PATCH] docs: update git aliases description --- README.md | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 105410e..0e0986a 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,8 @@ For linux users `FORGIT_COPY_CMD` should be set to make copy work. Example: `FOR #### aliases +##### shell + You can change the default aliases by defining these variables below. (To disable all aliases, Set the `FORGIT_NO_ALIASES` flag.) @@ -142,17 +144,36 @@ forgit_rebase=grb forgit_fixup=gfu ``` -Or if you prefer, you can also use git aliases (instead of shell aliases). To do this: -1. Set the `FORGIT_STANDALONE` flag - - example: `export FORGIT_STANDALONE=1` -2. Add the bin directory in `FORGIT_INSTALL_DIR` to your `PATH` - - example: `PATH="$PATH:$FORGIT_INSTALL_DIR/bin"` -3. You can now run any forgit command as a subcommand of git! - - example: `git forgit log` -4. Add (aliases in git)[https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases] - - example: `git config --global alias.cf 'forgit checkout_file'` -5. Use the alias in git instead of the shell - - example: `git cf` +#### git + +You can use git aliases by making `git-forgit` available in `$PATH`: + +```sh +# after `forgit` was loaded +export PATH="$PATH:$FORGIT_INSTALL_DIR/bin" +``` + +*Some plugin managers can help do this.* + +Then any forgit command will be a subcommand of git: + +``` +$ git forgit log +$ git forgit add +$ git forgit diff +``` + +Optionally you can add [aliases in git](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases): + +```sh +git config --global alias.cf 'forgit checkout_file' +``` + +And use the alias in git: + +```sh +git cf +``` #### pagers