This is not a script. You will want to just add these functions to your bash config (or make it into a script, do what you want, I'm not your mom)
You can remove all the other functions if you want to just replace ohai
and error
with echo
for simplicity (I just have those formatting functions at the top of my alias/function file in my bash config and use them in a lot of my functions. They are originally from the homebrew sourcecode)
- exit if not in git repo
- support a main branch other than
master
(useful if you are usingmain
or if you use something like gitflow and want to compare todevelop
,staging
, etc - exit if master/main branch doesn’t exist
- outputs number of cleaned branches
- squeaky clean ✨
- even if another main branch is specified, do not delete
master
ormain