DEV Community

Cover image for New Bash Alias: Git Out
Parth Agarwal
Parth Agarwal

Posted on • Updated on

New Bash Alias: Git Out

Up until now, we only had git commit and git push. But what about git out? If you know what it feels like to be left out, you should empathize with this command. Even though it is a part of this legendary trio, it is never actually used.

But not today, Not anymore!
Let's right the wrongs of this society!
So, if you are with me!

Open Your .bashrc File!

nano ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Add This Line! & Save it! (ctrl+x, y, return)

git() { if [[ $@ == "out" ]]; then command "exit"; else command "git $@"; fi; }
Enter fullscreen mode Exit fullscreen mode

And Finally! Source it!

source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Good job! Be Proud! Because of you, there is one less lonely command!

PS: Feel free to share any meme command out there.

Top comments (2)

Collapse
 
miguelmj profile image
MiguelMJ • Edited

Ok, I found this actually funny ๐Ÿ˜‚

A favorite of mine I don't remember where I got from:
Add the to your aliases

alias sudo=please
Enter fullscreen mode Exit fullscreen mode

so you can type

$ some_command
Permission denied
$ please some_command
Executing...
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ra101 profile image
Parth Agarwal

So relatable! This is the exact emotion behind sudo๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚