Tell MSYS2 Terminal to use existing .bashrc and .bash_profile from Git Bash

You have been using something like Git Bash and now switch to MSYS2 but want to use your old .bashrc like before

me@jaykilleen.com wrote this over 6 years ago and it was last updated over 6 years ago.


← Back to the Posts

I recently started using MSYS2 for Ruby on Rails development on Windows as per instructions on the RubyInstaller2.

Once I was setup though I was quickly missing my old .bashrc shortcuts.

No drama though. I followed this conversation I found between these devs who indicated you can change the MSYS2 default in the /etc/fstab file like below by adding c:/Users/KilleenJ /home/killeenj ntfs binary,posix=0,user 0 0.

I got here by opening the fstab using code /etc/fstab (I am now using Visual Studio Code but you could be doing something like atom /etc/fstab or vim /etc/fstab or gedit /etc/fstab if you have those other text editor programs installed).

  # For a description of the file format, see the Users Guide
  # http://cygwin.com/cygwin-ug-net/using.html#mount-table

  # DO NOT REMOVE NEXT LINE. It remove cygdrive prefix from path
  none / cygdrive binary,posix=0,noacl,user 0 0

  c:/Users/KilleenJ /home/killeenj ntfs binary,posix=0,user 0 0

What the last line does, I am guessing, is maps the home drive for MSYS2 to the home drive on the Windows directory. This way the .bashrc and .bash_profile files are loaded.

Yay!

By the way, it seems this RubyInstaller2 way of installing Ruby on Rails on a Windows environment is working really nicely compared to the RailsInstaller way. Fingers crossed this means a more friendly environment for Ruby on Rails development on Windows PCs.