At work, we use svn as a code repository and svnmerge for branch management. A coworker who recently switched to Mac asked me how he could assign a global variable so that he could run the svnmerge command without specifying the full path to the python script. The solution was to add an
alias to svnmerge that is loaded on shell startup. Since Mac OS X uses the bash shell, he needed to add the following to his
.profile file (the
.profile file sits in the home directory and can be created if it doesn’t yet exist):
svnmerge.py file also needs to be executable (
chmod a+x svnmerge.py). The changes will take effect the next time you open a new shell.
While I’m at it, it’s worth mentioning another useful option that I have in my .profile file. By adding
export CLICOLOR=1, the ls command will output in color to distinguish between directories, files, and executables.