天天看点

Pixhawk---fatal: Not a git repository (or any of the parent directories)

原文地址为: Pixhawk---fatal: Not a git repository (or any of the parent directories)

  当从github.com上面下载下了Firmware后,无意中删除了Firmware目录下的.git文件夹,再去编译就会出现:

  fatal: Not a git repository (or any of the parent directories)

的错误。这是由于本地版本管理仓库被删除了,需要重新初始化仓库,建立新的仓库:

  git init

Pixhawk---fatal: Not a git repository (or any of the parent directories)

  再次去编译又会出现如下错误:

  fatla: bad default revision ‘HEAD’

这是由于仓库里没有任提交在里面,所以它会报这个错。再执行下面的命令:

查看仓库状态:

  git status

添加本地工程所有文件到仓库中:

  git add -A

提交到仓库:

  git commit -m “custom your message”

Pixhawk---fatal: Not a git repository (or any of the parent directories)

再次去编译就不会有问题了。

转载请注明本文地址: Pixhawk---fatal: Not a git repository (or any of the parent directories)