DEV Community

loading...

Discussion on: Productivity 101: Git Aliases for Lazy Developers

Collapse
mattwaler profile image
Matt Waler

I think a lot of devs like a single source of truth for all of their aliases, regardless of the tools the aliases interact with. Both approaches are absolutely acceptable. No need to "bash" anybody else ;)

Collapse
190245 profile image
Dave

It's the OO dev in me - Single Responsibility Principle. ;)

Thread Thread
mattwaler profile image
Matt Waler

Could you not apply that same principle to a .bash_profile with all your system's aliases?

Thread Thread
190245 profile image
Dave

Of course, but I wouldn't put things like this into .bash_profile - .bashrc is preferred (for me). I'm not always in a login shell.

To me, git configuration, like shortcuts & PGP keys (that I shared with the OP) should be in the .gitconfig file, so if I'm looking to change them, that's the first place I'd look (on someone else's system/login).

CLI shortcuts, such as renaming "git" to "g" are correct in .bashrc - and indeed, you could reference git aliases from bash aliases, but at some stage, I think we descend into acronym hell. gpf expanding to git push -f would be OK, but I've seen some bad examples too.