DEV Community

Discussion on: Useful Git Alias

Collapse
 
computersmiths profile image
ComputerSmiths

Just curious: (I don't 'git', shows you what level Dev I am...) Does having aliases ever trip you up, especially if they aren't standard across developers or platforms? If I've got 'k' aliased to "kill all processes starting with the string " and you are used to !gitk and you sit down at my terminal to help me, Wierd And Unexpected Things are going to happen...

My experience with aliases is that it's hard to keep them in sync across many machines, and if something doesn't work, I spend more time looking up what I expect the alias to do than I saved by making it universal (for me). Half the time I have to remember which machine(s) it works on and ssh over there to show me the alias, not a time-saving maneuver...

If it's company-wide and everyone knows what to expect, then it's probably OK, but "I wish this was a command" always strikes me as fraught with peril.

Collapse
 
committedsw profile image
Committed Software

That’s a fair question and something that does put people off using them. It can trip me up, but it doesn’t happen much. I have my aliases on a gist (gist.github.com/stuarthendren/7a3b...) so if I change machine, or go to the cloud, I can quickly set them up again. If I’m on someone else machine I would try to avoid making commits and getting them into trouble. I also wouldn’t recommend using aliases until you’re confident with git, that way you aren’t reliant on the aliases and should still know the underlying commands.