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
这里写图片描写叙述
  再次去编译又会出现例如以下错误:
  fatla: bad default revision ‘HEAD’
这是因为仓库里没有任提交在里面,所以它会报这个错。再运行以下的命令:
查看仓库状态:
  git status
加入本地project全部文件到仓库中:
  git add -A
提交到仓库:
  git commit -m “custom your message”
这里写图片描写叙述
再次去编译就不会有问题了。

原文地址:https://www.cnblogs.com/brucemengbm/p/7264186.html