【交叉编译报错】fatal: not a git repository (or any of the parent directories): .git
问题
在交叉编译内核文件时候,出现报错:fatal: not a git repository (or any of the parent directories): .git
原因如下:
- 最开始使用的是压缩包下载方式:ebf_lubancat2-master.zip到window
- 然后再到Ubuntu中进行解压缩。
- 解压缩之后,进入ebf_lubancat2-master路径,输入make clean 报错。
解决方法
【如果是内核或开源项目,建议用 git clone 替代源码压缩包:】
# 删除现有非 Git 源码
rm -rf ebf_lubancat2/# 重新克隆(以 Linux 内核为例)
git clone https://gitee.com/qiaoyuguo/ebf_lubancat2.git
cd ebf_lubancat2
make clean # 此时不会报错