Question

I'm learning to work with git, and I tried to set some aliases like this:

git config --global alias.trololo 'status'

So now when I type git trololo it works like git status.

Now trololo alias is not needed. How can I correctly delete it?

Was it helpful?

Solution

You can try --unset in git config:

git config --global --unset alias.trololo

I find it safer than editing directly the config file (git config --global --edit)

OTHER TIPS

In case someone has multiple values for the same alias and has got that:

$ git config --global --unset alias.trololo
warning: alias.trololo has multiple values

Use --unset-all

git config --global --unset-all

Or just:

vim ~/.gitconfig

And delete the alias lines.

You can remove it by deleting that line from the configuration file or you can try this:

git config --global --unset alias.YourAlias

You can manually remove it in your global settings files by:

  • Running git config --global -e
  • Locate the alias in the opend global settings file.
  • Erase it, and save the file.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top