search

Home  >  Q&A  >  body text

What's going on with git: command not found?

Use git --version to see the version

[www@i001 ~]$ git --version
git version 2.8.0

But when I want to clone something, it turns out to be git: command not found. What’s going on?

[www@i001 ~]$ sudo -Hu www git clone https://git.coding.net/msiaxxxx/test001.git /home/wwwroot/test001  --depth=1
sudo: git: command not found

After adding the git installation path, execute

[www@i001 ~]$ sudo -Hu www /usr/local/git/bin/git clone https://git.coding.net/msiaxxxx/test001.git /home/wwwroot/  --depth=1
fatal: could not create work tree dir '/home/wwwroot/test001': Permission denied

is Permission denied, and the same thing happens when you switch to root user.

曾经蜡笔没有小新曾经蜡笔没有小新2795 days ago1506

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-05-02 09:33:12

    Have you installed it? It should not be installed, right?

    If you try to type git 看会得到什么,如果还是 not found directly, it means it is not installed. Normally, mine will output:

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-02 09:33:12

    1. Why use sudoclone?

    2. sudo /usr/bin/git clone xxxxx

    reply
    0
  • Cancelreply