When you setup your bash environment, splitting up the files are a good idea to keep things organized. Normally you would end up with a set o files like:
.bash_profiles
.bashrc
.bash_aliases
.bash_functions
- … perhaps more
Recently I added a couple of things for git, and to not “break” my setup, they went in the different files. But, it felt wrong - so I made a separate file for that content instead. Also, easier to add in, share (like this) etc…
So, I added an xtra .bash_git
to my setup. This is my version for OS X, but I use the same in Linux, except for the path to git-completion.bash
- which is just a matter och editing the path to it. And the clipboard needs to be removed (see below).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Load it in your .bashrc
(or .bash_profile
if you are using that one) with:
# Load: ~/.bash_git
[ -f ~/.bash_git ] && . ~/.bash_git
Edits
The last function (gitio()
)… At the end you might want to remove pbcopy
:
echo -n $(curl -i http://git.io -F "url=$_url" | grep 'Location' | awk '{ print $2 }');
… &/or replace it with xclip
for Linux/*BSD:
echo -n $(curl -i http://git.io -F "url=$_url" | grep 'Location' | awk '{ print $2 }') | xclip -selection clipboard;