From c67f766b883136d74496402e97ef24b2a3d1d82e Mon Sep 17 00:00:00 2001 From: allan Date: Sun, 8 Feb 2026 15:20:48 +0100 Subject: [PATCH] added info --- README.md | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ad6874b..70c6eda 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,20 @@ The Git prompt behavior will continue to work normally. --- +### FAQ + +**Q:** Does this replace my default prompt entirely? +**A:** While loaded, the script manages PS1 so it can switch automatically between Git and non-Git directories. Outside repositories a simplified prompt is shown; inside repositories the Git-aware prompt is shown. + +**Q:** Can I create my own theme? +**A:** Absolutely. Each theme is defined in the script under `set_git_prompt_theme_icons()`. +You can modify or extend it, then set your new theme using `export GIT_PROMPT_THEME=`. + +**Q:** Does it slow down Git-heavy directories? +**A:** Negligibly. The script uses optimized Git calls and caches status checks for performance. + +--- + ### Troubleshooting **Symbols not showing correctly:** @@ -237,19 +251,31 @@ fi # Git Prompt Stop ``` ---- +**I changed my root prompt in the script but it’s not working:** +This is most likely because the bash-git-prompt is not loaded for the root account. -### FAQ +The script only affects the user whose `.bashrc` loads it. +If you switch to root using `sudo`, root uses `/root/.bashrc`, which normally does not load the bash-git-prompt. -**Q:** Does this replace my default prompt entirely? -**A:** While loaded, the script manages PS1 so it can switch automatically between Git and non-Git directories. Outside repositories a simplified prompt is shown; inside repositories the Git-aware prompt is shown. +To use the Git prompt as root, you must either: -**Q:** Can I create my own theme? -**A:** Absolutely. Each theme is defined in the script under `set_git_prompt_theme_icons()`. -You can modify or extend it, then set your new theme using `export GIT_PROMPT_THEME=`. +1. Clone the repository into root’s home directory and load it from `/root/.bashrc`, or +2. Load the script from its existing location by using the full path in `/root/.bashrc`, or +3. Create a symbolic link in root’s home directory pointing to the existing installation. -**Q:** Does it slow down Git-heavy directories? -**A:** Negligibly. The script uses optimized Git calls and caches status checks for performance. +Example using a full path: + +``` +source /home//.bash-git-prompt/bash-git-prompt +``` + +Example using a symbolic link: + +``` +ln -s /home//.bash-git-prompt /root/.bash-git-prompt +``` + +Make sure the root user has read access to that path. ---