In Git, you can create custom commands using either an alias or by creating an executable file included in your PATH, starting with git- . Is there any reason to choose an alias as opposed to a script?
I work with a development team and made some useful aliases that I would like to share with them. One of my colleagues suggested that aliases should be used for simple things, for example, to shorten a command (for example, git co as an alias for git checkout ), and that scripts will be useful for more complex tasks, such as combining several functions into one. But he could not think of why not use the scripts, not sure how much he felt it should be, or if he heard somewhere that it should be, or what.
Our team works on one development server, so if I can use a script, I can just put it in /usr/local/bin , and everyone will have access to it automatically. Thus, even with a simple alias, it would be much more convenient to just use it as a git script so that everyone would use it automatically, unlike what I had to tell everyone to configure it individually. Not to mention that when the new developer starts, we will have to remember that they also set it up.
I know it sounds like I'm in favor of a script approach, and I am. I'm just wondering if there is a flaw in using this approach.
source share