The practice of PHP… And more!

Make your .bash_profile aliases available anywhere

Bash aliases are one of the truly great timesavers when working in Unix/Linux. I’ve picked up quite a few aliases from others on my travels around the Internet and many have become second nature. Moreover, in quite a few cases, I’ve (almost) forgotten the original command!

Lately, I’ve done a lot of development work using Vagrant and, honestly, I’d never want to go back to trying to set up development environments on individual machines, since Vagrant makes standardization so simple. At the same time, even though my Vagrant box is pretty well standardized, everyone probably has their on bash aliases that they like to use. So, here’s how to have the best of both worlds!

What we want to do is provide a simple way to grab our bash aliases from Github and apply them from most any machine.

Put your bash aliases (or any other bash settings!) into a file a file named .bash_alias and add this file to your Github account. The conventional practice is to put these in a repository named dotfiles.

Viola! All of your aliases are now available on this machine. And, of course, you can add this command to your .bash_profile on that machine, so that it will run automatically everytime you log in.

Note: When dealing with your Unix/Linux configuration files (“dotfiles”), it is very important to pay attention to the line endings of your files. Windows and Unix/Linux use different conventions. The best way to account for this is to set the autocrlf parameter in the dotfile repository on your workstation by running: