Git 报错 refname refs/heads/main not found

当执行  git branch -M main

报错:refname refs/heads/main not found

解决方法

执行:git add .

执行:git commit -m "init"

然后再执行:refname refs/heads/main not found

如果执行 git commit -m "init"

报错:

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got '*@DESK***-******.(none)')

解决:你需要和你的远程仓库进行连接

git config --global user.email 

git config --global user.name "Your Name"

猜你喜欢

转载自blog.csdn.net/weixin_51299408/article/details/121525816