I’m trying to use to use the same name for an alias as the existing command, so that the alias shadows the original command (preventing me from deleting files off the working tree).
[alias]
rm = rm --cached
diff = diff --color
Unfortunatly this is not working. Does anyone know a workaround?
Thanks.
Edit
Setting color.diff = true gives colored output as default.
For commands like
rm --cachedthat don’t have configurable options, your best bet is to just make an alias named differently. For example:You may have already figured this out, but Git aliases cannot shadow existing Git commands. From the
git-configman page: