0

Every time I open a new window in iTerm (or Terminal) on my Mac, it will pause for a second or two, and then print this message:

-bash: alias:  | grep -v 127.0.0.1: not found
fatal: Not a git repository (or any of the parent directories): .git

It's clear to me that it's executing this grep / git command on every new window, but I can't figure out where this is coming from, nor how to make it stop.

Where can I find this command?

Smee
  • 914
  • 1
  • 8
  • 14

2 Answers2

0

In preferences -> profiles -> general you can remove the command from the "Send text at start" field.

This will stop the command from running every time you start a new shell.

tehp
  • 5,018
  • 1
  • 24
  • 31
0

I had a problem with this as well, but it wasn't this particular bash command. I had some commands that were run in my .zshrc file that I needed to remove.

To do this, I ran vim and removed the commands. Yours might look something like:

# Run your /.zshrc file to confirm that it is the source of your error
source ~/.zshrc 

# If it is, open it in vim
vim ~/.zshrc

# While in vim, you can search by hitting the forward-slash key "/" and then 
# typing your search word. Navigate through results with the next key "n". Perhaps
# you could search for grep, which shouldn't occur often in your .zshrc file.
/grep 

# Remove/fix the offending line
Lee James
  • 91
  • 1
  • 5