-1

I have a shortcut that was added to my computer in Terminal. (I use zsh). Instead of having to type git add -all I can type gaa. My question is:

Any ideas where/how this shortcut made? How can I see exactly what command it is short for and how do I change it?

After following these instructions, I thought I'd be able to see it in ~/.gitconfig but it's not there. It doesn't look like it's in ~/.zshrc either:

enter image description here

enter image description here

tonitone120
  • 1,920
  • 3
  • 8
  • 25

1 Answers1

1

You’re using Oh My Zsh, which adds a bunch of aliases.

You’re most likely loading their file in your ~/.zshrc.

JBallin
  • 8,481
  • 4
  • 46
  • 51
  • Thanks for the response @JBaillin. Unfortunately, it's not in there. – tonitone120 Nov 05 '20 at 02:03
  • The exact definition is in a file source, either directly or indirectly, by `.zshrc` (or possibly `.zprofile`). – chepner Nov 05 '20 at 02:06
  • @tonitone120 it's in your zshrc. Look at line 3. Line 1 is where you're enabling the git plugin. – JBallin Nov 05 '20 at 02:23
  • @JBallin What is line3? What's the meaning of it? Bear in mind my goal's still to delete this shortcut (and add others) – tonitone120 Nov 05 '20 at 02:27
  • I'm referring to line 3 in the image you shared of zshrc (`source $ZSH/oh-my-zsh.sh`). You can uninstall oh my zsh by following these [instructions](https://github.com/ohmyzsh/ohmyzsh/#uninstalling-oh-my-zsh). You can also disable the git plugin (delete line 1 - `plugins=(git)`) or just overwrite their aliases with your own. Line 3 is loading (source) the file (path to file). – JBallin Nov 05 '20 at 02:29
  • So is there a folder called `ZSH`? And if so, where? I'm not so much as looking to remove the oh-my-zsh so much as just see what shortcuts are being made and alter them - if that were possible – tonitone120 Nov 05 '20 at 02:36
  • `$ZSH` is a variable that you're defining in the top image. I don't recommend altering their existing aliases. You can just make your own `alias gaa="git add --all"` (you have one at the bottom of your `zshrc` already). – JBallin Nov 05 '20 at 02:46
  • Okay, well thanks for your answer showing me these shortcuts come from oh-my-zsh (if I've understood you correctly) and pointing out I can overwrite them with aliases at the bottom of my `.oh-my-zsh` file. – tonitone120 Nov 05 '20 at 12:55
  • @tonitone120 you should use your zshrc. That's your personal file to configure your zsh (you can google "dotfiles" to find examples). Files belonging to oh my zsh may get changed by updates etc., I wouldn't recommend altering those. – JBallin Nov 05 '20 at 16:16
  • Yes sorry meant to say 'I can overwrite them with aliases at the bottom of my `.zshrc` file – tonitone120 Nov 05 '20 at 16:33