解决 git 问题:fatal: not a git repository (or any of the parent directories): .git

@[TOC](解决 git 问题:fatal: not a git repository (or any of the parent directories): .git)

1、出现

今天使用 git 增加新的远程主机的时候,发现报下面这个错:fatal: not a git repository (or any of the parent directories): .git,如图:

在这里插入图片描述
提示说没有 .git 这样一个目录

2、解决办法

在命令行输入 git init 然后回车就好了

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/a6661314/article/details/125722314