A Bash/ZSH prompt script that displays Git repository status, replicating the PowerShell posh-git experience.
posh-git-sh is a Bash and ZSH script that enhances terminal prompts by displaying real-time Git repository status. It shows branch information, upstream divergence, and file change counts directly in the prompt, eliminating the need to run `git status` manually. The project replicates the functionality of the Windows PowerShell posh-git module for Unix-like shells.
Developers using Bash or ZSH who work frequently with Git and want immediate visibility into repository status without interrupting their workflow. It's especially useful for those transitioning from PowerShell or seeking a more informative prompt.
It provides a highly configurable, informative Git prompt that integrates seamlessly with existing shell setups, offering detailed status at a glance while maintaining performance and compatibility with standard Git configuration methods.
Bash/ZSH version of the posh-git command prompt
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Shows branch name, upstream divergence with color coding, and counts for staged/unstaged changes, providing immediate repository awareness without extra commands, as detailed in the prompt format section.
Allows customization via git config settings per repository, such as enabling/disabling file status or stash indicators, making it flexible and easy to adjust without editing shell scripts directly.
Works with both Bash (via PROMPT_COMMAND) and ZSH (via precmd hook), supporting a wide range of developers on Unix-like systems, as documented in the installation instructions.
It's a single shell script that integrates seamlessly into existing setups, with no external dependencies beyond Git, keeping it simple and maintainable.
Computing file changes can be slow in big repositories, forcing users to disable features like bash.enableFileStatus for speed, as admitted in the configuration options.
Requires copying files and modifying shell configuration files (e.g., .bashrc or .zshrc), which can be error-prone for less experienced users and lacks a package manager install option.
Has a known issue with prompt wrapping in Terminal.app when prompts are long, due to ANSI color code handling, which limits usability on some macOS setups without workarounds.