## Bash git prompt for Ubuntu 24.04 This is a bash git prompt with 5 themes that displays usefull information about the current git repository. ### Note This should work fine on other distros as well I have tested this on RHEL 8,9,10 Fedora 41 and 42 as well as Ubuntu 22.04 24.04 ### Prompt Structure. The default "Out Of The Box" theme appearance of the prompt looks like this. ```plaintext ``` ### And it looks like this

default theme

### DejaVuSansMono Nerd Font has to be present in order to display the fancy symbols listed below.

extended symbols

### Install via git clone ``` git clone https://git.x-files.dk/bash/bash-git-prompt.git ~/.bash-git-prompt ``` ### Install the required fonts used by the git-bash-prompt ```bash cd ~/.bash-git-prompt ./install-fonts.sh ``` ### Getting everything up and running. **Important:** Remove all other git prompts you have in your ~/.bashrc file. Then add the following to your ~/.bashrc file. ```bash # Git Prompt Start if [ -f "$HOME/.bash-git-prompt/bash-git-prompt" ]; then export GIT_PROMPT_THEME=1 source "$HOME/.bash-git-prompt/bash-git-prompt" fi # Git Prompt Stop ``` ### Changing themes This can be done on the fly by simply typing the command "gpchange" followed by a theme number e.g like this: ```bash gpchange 3 ``` ### Themes The image is showing the 5 themes with every git status available. I know it's not possible to have a clean and dirty state at the same time, but this is for demo / clarification purpose. The following icons are displayed in this order for demonstraion purpose. Branch → Staged → Changed → Untracked → Stashed → Ahead → Behind → No-Remote → Conflict → Dirty → Clean

extended symbols

### Set your terminal to use the DejaVuSansMono Nerd Font Mono as shown below.

Terminal font settings

### More guides More guides can be found on [\[wiki.x-files.dk\]](https://wiki.x-files.dk) ### Last tested June 25th 2025 on Ubuntu 24.04.