| Environment | Config file location | |-------------|----------------------| | (Git for Windows) | ~/.bashrc (usually C:\Users\YourName\.bashrc ) | | WSL (Windows Subsystem for Linux) | ~/.bashrc inside the Linux distro | | MSYS2 / Cygwin | ~/.bashrc |
So yes— in all of them. The trick is making sure it’s actually loaded. The Problem: Bash on Windows Doesn’t Always Read .bashrc In Git Bash, when you open the terminal, it often runs as a login shell (which reads .bash_profile ) or an interactive non‑login shell (which should read .bashrc ). But sometimes it doesn’t.
If you’ve just moved from macOS or Linux to Windows (or you’re dual-booting), one of the first things you’ll miss is your trusty .bashrc . That one file where you store aliases, custom prompts, and environment variables.
export PS1="\u@\h \w[\033[32m]$(parse_git_branch)[\033[00m] $ " After editing .bashrc , run:
Windows Bashrc -
| Environment | Config file location | |-------------|----------------------| | (Git for Windows) | ~/.bashrc (usually C:\Users\YourName\.bashrc ) | | WSL (Windows Subsystem for Linux) | ~/.bashrc inside the Linux distro | | MSYS2 / Cygwin | ~/.bashrc |
So yes— in all of them. The trick is making sure it’s actually loaded. The Problem: Bash on Windows Doesn’t Always Read .bashrc In Git Bash, when you open the terminal, it often runs as a login shell (which reads .bash_profile ) or an interactive non‑login shell (which should read .bashrc ). But sometimes it doesn’t. windows bashrc
If you’ve just moved from macOS or Linux to Windows (or you’re dual-booting), one of the first things you’ll miss is your trusty .bashrc . That one file where you store aliases, custom prompts, and environment variables. But sometimes it doesn’t
export PS1="\u@\h \w[\033[32m]$(parse_git_branch)[\033[00m] $ " After editing .bashrc , run: and environment variables.