Let git remote accept up as alias to update
PATCH 1/1 Let git remote accept up as alias to update
---
Don't know why, but I keep typing remote up instead of remote update. As update is probably by far the most used remote action, can we please have this alias?
builtin-remote.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
builtin-remote.c +1 -1
@@ -893,7 +893,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix) result =show (argc, argv); else if (!strcmp(argv[0], "prune")) result =prune (argc, argv); - else if (!strcmp(argv[0], "update")) + else if (!strcmp(argv[0], "update") || !strcmp(argv[0], "up")) result = update(argc, argv); else {error ("Unknown subcommand: %s" , argv[0 ]);
Quoted 6 lines · Alexey Zaytsev
Signed-off-by Alexey Zaytsev <[email protected]>---
Don't know why, but I keep typing remote up instead of remote update. As update is probably by far the most used remote action, can we please have this alias?
Hmm. The usual answer for requests like this is "make your own alias". But usually they are for primary command aliases (e.g., "co" for "checkout"), and this is a sub-command. So you are actually stuck doing:
git config alias.rup "remote update"
which is maybe better (even less typing) but is not exactly what you asked for.
I think even nicer than an explicit "up" alias would be to accept any prefix as long as it was unique. However, I think a scheme like that would only make sense if it was used fairly universally, and the current code is not amenable to doing it for regular commands (it doesn't actually have a complete list of commands -- it just tries to exec what you tell it). However, it could be refactored to do so.
-Peff