I think is better idea to upload to a repository. Let me tell you how I did it.
I version the whole
~/bin directory. My
.bash_profile is on that directory. The
$HOME/.bash_profile is a link to
.bash_profile looks like this:
if [[ $OSTYPE == darwin* ]]; then
elif [[ $OSTYPE == linux* ]]; then
That way I can easilly track changes.
To keep the repo update you can create a cron or LaunchAgents script that pull the changes on your
~/bin directory once a day:
cd ~/bin && git pull origin $(git name-rev --name-only HEAD)