首页 > git: command not found是怎么回事?

git: command not found是怎么回事?

git --version可以看到版本

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

但是我要clone一个东西的时候,却是git: command not found,怎么回事呢?

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

加上git的安装路径后,执行

[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

却是Permission denied,换成root用户,也是这样的.


你安装了了吗?应该是没有安装吧?

你试着直接敲 git 看会得到什么,如果还是 not found,那就是没有安装了。正常的像我的会输出:


  1. 为什么要用sudoclone?

  2. sudo /usr/bin/git clone xxxxx

【热门文章】
【热门文章】