3 ms·
The danger of this is if you accidentally write 'git git something' into a shell script and it works on your machine, then you commit the script to a repo and i
by asveikau 9y ago
The danger of this is if you accidentally write 'git git something' into a shell script and it works on your machine, then you commit the script to a repo and it doesn't work for anyone else.
I suppose this is a problem with any alias.
- thisacctforreal 9y agoI find writing shell scripts is a different mental process than interacting with the commandline, so I think the problem of “starting a command then leaving the terminal” is non-existant in that context.
- xelxebar 9y agoOne way around that issue is to prefix commands you intend to share with backslash: $ \gstatus gstatus: command not found vs $ gstatus git status stuff The backslash just disables alias expansion. This works on all shells I'm aware of. It won't help with other portability concerns like actual missing commands though, of course.