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

这篇具有很好参考价值的文章主要介绍了解决git提示fatal: not a git repository (or any of the parent directories): .git。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

1、创建分支时提示:not a git repository

E:\myproject>git checkout -b zhenzhu
fatal: not a git repository (or any of the parent directories): .git

2、怎么办?

git init--》git status--》git checkout -b test20230217--》成功

3、为什么?

一般是没有初始化git本地版本管理仓库,使用init命令行初始化,再status查看状态,正常后继续报错前命令行即可;

补充说明:

1、git init 初始化git仓库
2、git status 查看文件状态

3、创建并切换到新分支
    git checkout -b xxxx   (xxx--》是你自己起的分支名称)

4、git checkout命令加上-b参数表示创建并切换,相当于以下两条命令:

 $ git branch dev (创建)

$ git checkout dev (切换--》切换到基础分支如下:git checkout master)

fatal: not a git repository (or any of the parent directories): .git,git,github

 文章来源地址https://www.toymoban.com/news/detail-779886.html

到了这里,关于解决git提示fatal: not a git repository (or any of the parent directories): .git的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • fatal: not a git repository (or any of the parent directories): .git

    小编遇到这样一个问题,当git clone 后,进行分支切换时,报错fatal: not a git repository (or any of the parent directories): .git 而且出现了分支无法查询到的情况下 解决方法:进去.git文件夹 再打开git终端, 如果直接在此处进行分支切换,会提示报错   输一下git branch -a 再回退到上一级

    2024年02月12日
    浏览(40)
  • 执行git命令报错:fatal: not a git repository (or any of the parent directories): .git

    执行git命令报错: 没有初始化git本地版本管理仓库,在打开文件的子目录层级中不包含.git文件,所以无法执行git命令。 执行git初始化 ,进行初始化 查看其状态

    2024年02月16日
    浏览(37)
  • 【Git】git pull 报错 fatal: not a git repository (or any of the parent directories): .git

    在使用 git pull 拉取仓库时报错,错误信息如下图所示: 这个错误表明当前目录不是一个 Git 仓库,因此无法执行 git pull 命令。 错误提示中指出当前目录不是一个 Git 仓库,因此无法执行 git pull 命令。这可能是因为在一个不是 Git 仓库的目录中使用了 Git 命令。 使用 git init 命

    2024年02月04日
    浏览(32)
  • git命令报错:fatal: not a git repository (or any of the parent directories): .git husky - git command not

    git命令报错: fatal: not a git repository (or any of the parent directories): .git husky - git command not found, skipping install 报错原因: 没有初始化git本地版本管理仓库,在打开文件的子目录层级中不包含.git文件,所以无法执行git命令。 解决方案: 执行git初始化 ,进行初始化 查看其状态 参考

    2024年02月04日
    浏览(40)
  • fatal: Not a git repository (or any parent up to mount point /home)解决方法

    Git遇到一个问题: fatal: Not a git repository (or any parent up to mount point /home) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). 解决办法:git init 错误信息指出不是一个git仓库,或者它的父级目录也不是git仓库。请确保您在正确的目录中执行git命令,并且该目录是一个有效的

    2024年02月05日
    浏览(41)
  • 如何解决go.mod file not found in current directory or any parent directory?

    环境变量配置: 假如安装路径: /usr/local/go 那么这样配置环境变量: vi ~/.bash_profile 然后保存,执行source ~/.bash_profile 报错go.mod file not found in current directory or any parent directory? 解决: go env -w GO111MODULE=auto OK,问题解决

    2024年02月12日
    浏览(42)
  • git 解决 “fatal: Could not read from remote repository.“

    现象 在使用Git将本地仓库推送到远程仓库的时候,发生了如下错误:“fatal: Could not read from remote repository.”   原因 出现这错误一般是以下两种原因: 客户端与服务端未生成 ssh key 客户端与服务端的ssh key不匹配 为解决以上问题,我们需要重新生成一次ssh key ,并重新配置一

    2024年02月09日
    浏览(32)
  • git clone 报错:fatal: Unencrypted HTTP is not supported for GitLab. Ensure the repository remote URL i

     git版本问题,是当前版本过高,要求使用https协议,需要根据需要安装指定版本。遇到这个问题时我的git版本是:  需要安装指定版本。

    2024年02月11日
    浏览(37)
  • git clone出现fatal: Could not read from remote repository解决办法

    在git clone一个项目时出现如下报错: (第一个选项,问你是否继续连接?输入yes然后回车) 通过报错信息可以看出,这是因为Github上没有本机的公钥导致的。 其中双引号中填自己Github注册账号用的邮箱地址。 点击回车,看到提示 说明:前三个冒号分别让你输入保存公钥的

    2023年04月15日
    浏览(71)
  • [Go 报错] go: go.mod file not found in current directory or any parent directory

    Build Error: go build -o c:Users13283Desktopgodemo__debug_bin3410376605.exe -gcflags all=-N -l . go: go.mod file not found in current directory or any parent directory; see \\\'go help modules\\\' (exit status 1) go 的环境配置问题。与 golang 的包管理有关 如果你是 Windows 系统,快捷键 “Win+R”,输入cmd,打开终端。输入: 解

    2024年02月09日
    浏览(34)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包