gitzshapple-m1

Why does zsh kills my process every time I enter a git command


I'm trying to set up git on my apple M1 macbook air. I tried to run git and I saw that I needed to update my command-line-tools first and so did I. But now, every time I tried to enter a git command, I see the same line again and again: zsh: killed git.

For example, when I type git the terminal tells me: zsh: killed git, when I type git --version the terminal tells me: zsh: killed git --version and so on. Does someone knows where the problem comes from and how to solve it?

Thanks for reading and trying to find an answer.


Solution

  • Here I put the final solution. I tried many methods on my mac M1, the best method is re-install homebrew.

    Step1:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
    

    Step2: Install homebrew

    cd /opt 
    mkdir homebrew # if not exist, just create one.
    curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
    

    Then, the problem solved.