From 637b5d5534469ebb15826139e1b3df12a1cc9309 Mon Sep 17 00:00:00 2001 From: Reinaldo Colina Date: Thu, 27 Aug 2015 12:14:13 -0700 Subject: issue-17: Add arguments to make the prompt shorter --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index d4bd3dd..f126a21 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,19 @@ Prompt | Meaning ![git:(m 4 → my-branch)] | There are 4 commits on `origin/master` that aren't on `origin/my-branch` ![git:(m 1 ⇄ 2 my-branch)] | `origin/master` and `origin/my-branch` have diverged, we'll need to rebase or merge +If you don't rely on this status, you can always hide this part of the prompt by calling git-radar with `--no-remote-status`. + +**Bash** +```bash +export PS1="$PS1\$(git-radar --bash --fetch --no-remote-status) " +``` +(note: the `\` escaping the `$` is important) + +**Zsh** +```zsh +export PROMPT="$PROMPT$(git-radar --zsh --fetch --no-remote-status) " +``` + ### (Optional) Auto-fetch repos Ensuring your refs are up to date I found can be a pain. To streamline this @@ -124,6 +137,21 @@ export PS1="$PS1\$(git-radar --bash --fetch)" export PROMPT="$PROMPT$(git-radar --zsh --fetch) " ``` +### (Optional) Minimal mode + +If you wish to keep the length of your prompt shorter, you can call git-radar with `--minimal` which will render the new prompt without the `git:` part + +**Bash** +```bash +export PS1="$PS1\$(git-radar --bash --fetch --minimal) " +``` +(note: the `\` escaping the `$` is important) + +**Zsh** +```zsh +export PROMPT="$PROMPT$(git-radar --zsh --fetch --minimal) " +``` + ## License Git Radar is licensed under the MIT license. -- cgit v1.2.3