This guide will help you set up and effectively use Windows Terminal with Git Bash and Oh My Zsh for an improved command-line experience.
Windows Terminal is a modern terminal application that allows you to use multiple command-line tools in tabs.
Microsoft Store Method (Recommended):
Manual Installation:
.msixbundle
fileGit Bash should automatically appear as a profile in Windows Terminal after installation. If not:
Configure these settings:
C:\Program Files\Git\bin\bash.exe
(adjust if your installation path differs)%USERPROFILE%
C:\Program Files\Git\mingw64\share\git\git-for-windows.ico
Command | Description | Example |
---|---|---|
pwd |
Print working directory (current location) | pwd |
ls |
List files and directories | ls -la (show all files with details) |
cd |
Change directory | cd Documents or cd .. (go up one level) |
mkdir |
Create a new directory | mkdir projects |
rm |
Remove files | rm filename.txt |
rmdir |
Remove empty directory | rmdir emptydir |
touch |
Create an empty file | touch newfile.txt |
cp |
Copy files | cp file.txt Documents/ |
mv |
Move or rename files | mv file.txt newname.txt |
cat |
Display file contents | cat file.txt |
clear |
Clear terminal screen | clear |
history |
Show command history | history |
While Git Bash uses Bash by default, you can enhance your experience with Oh My Zsh by installing Zsh.
Using Git Bash Package Manager:
# Update package lists
pacman -Syu
# Install zsh
pacman -S zsh
Alternative Method (if pacman doesn’t work):
C:\Program Files\Git
)Set Zsh as default shell:
# Add this to your ~/.bashrc file
if [ -t 1 ]; then
exec zsh
fi
Install Oh My Zsh using curl:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
After installation, restart Git Bash to apply changes
Edit your configuration file:
nano ~/.zshrc
Change the theme by modifying the ZSH_THEME
line:
# Popular themes: robbyrussell, agnoster, avit, bira
ZSH_THEME="robbyrussell"
Add plugins by modifying the plugins
line:
plugins=(git vscode)
Save changes and apply them:
source ~/.zshrc
Add custom shortcuts by editing your ~/.zshrc
file:
# Example aliases
alias gs="git status"
alias gc="git commit -m"
alias ll="ls -la"
To add permanent environment variables:
Edit your ~/.zshrc
file:
nano ~/.zshrc
Add export statements:
export JAVA_HOME="/c/Program Files/Amazon Corretto/jdk17.x.x_x"
export PATH=$PATH:$JAVA_HOME/bin
Apply changes:
source ~/.zshrc
“Command not found” errors:
Permission issues:
ls -la
Path issues:
/c/Users/...
instead of C:\Users\...
Accessing Windows drives:
/c
, /d
, etc.cd /c/Users/username/Documents
Running Windows commands:
.exe
suffixnotepad.exe file.txt
Last updated: May 4, 2025