Customize your Git bash like this
Let’s spice up our default git bash terminal into a good-looking modern terminal. The final version of our git bash is gonna look something like this.
Requirements
Before getting started, make sure you have downloaded all these required files.
Nerd Fonts (download and install your favorite font)
Add git bash in windows terminal
Copy following code in settings.json
"guid": "{00000000-0000-0000-ba54-000000000002}","commandline": "%PROGRAMFILES%/git/usr/bin/bash.exe -i -l","icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico","name" : "Bash","startingDirectory" : "%USERPROFILE%"
If you want then you can make this terminal as default in the windows terminal.
Add zsh package
Extract the content to your git bash installation dir: Usually C:\Program Files\Git
using PeaZip.
Now open git bash and type zsh, if it starts zsh then you are good to go.
Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
You need to edit ~/.bashrc file to make zsh the default shell. Add the following lines at the end of the file.
# Launch Zsh
if [ -t 1 ]; then
exec zsh
fi
Install powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
After install, you need to add powerlevel10k as zsh theme for that you need to edit ~/.zshrc to following
Now open another instance of git terminal in a windows terminal, you should see something like this.
Now choose options as per your desire and finish the configuration.
Time to change colors
Your terminal may not look like mine because you need to change your color scheme in the windows terminal, Open settings.json, and paste this scheme.
"name": "MyScheme","black": "#070707","red": "#fc0744","green": "#bbbbbb","yellow": "#ffdb8e","blue": "#b3007d","purple": "#d57bff","cyan": "#76c1ff","white": "#c7c7c7","brightBlack": "#686868","brightRed": "#ff6e67","brightGreen": "#00ff88","brightYellow": "#ffe600","brightBlue": "#ff9900","brightPurple": "#00b0ff","brightCyan": "#00aeff","brightWhite": "#ffffff","background": "#24283f","foreground": "#d6c9ff"
To enable the acrylic effect copy these lines and paste them into the git bash profile.
"acrylicOpacity": 0.8,"useAcrylic": true
Bonus,
To enable Autosuggestions, Git Clone the zsh-autocomplete
plugin in the .oh-my-zsh plugin folder.
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Now, add the plugin in the ~/.zshrc
file's plugin list.
Now your git bash should look like mine.