git: command not found是怎么回事?

 晴晴qing951025 发布于 2022-10-27 23:04

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用户,也是这样的.

2 个回答
    1. 为什么要用sudoclone?

    2. sudo /usr/bin/git clone xxxxx

    2022-10-29 05:46 回答
  • 你安装了了吗?应该是没有安装吧?

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

    2022-10-29 05:49 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有