This commit is contained in:
JIAL 2023-11-18 20:11:21 +08:00
parent 27005abd8f
commit 9e6a590f20
1 changed files with 30 additions and 1 deletions

View File

@ -22,4 +22,33 @@ git commit -m "提交的说明"
git push origin main
error: src refspec master does not match any
检查自己的分支名,不能推送给其他分支
检查自己的分支名,不能推送给其他分支
新建仓库
git init
git checkout -b main
git remote add origin http://43.138.57.202:3000/JIAL/VSCode.git
git config --global user.name "JIAL"
git config --global user.email "2287346125@qq.com"
然后就可以拉取文件或者直接打开git仓库克隆
git 中,有时在使用以下命令行时
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
报下面的错误:
warning: user.name has multiple values
error: cannot overwrite multiple values with a single value
Use a regexp, --add or --replace-all to change user.name.
我们用命令
git config --list// 这条指令可以查看到 git 相关配置信息,可以看到已经无意间添加了多个 name 值
这时发现是因为user.name有多个值导致的
解决方法:
$ git config --global --replace-all user.name "你的 git 的名称"
$ git config --global --replace-all uesr.email "你的 git 的邮箱"
做完这一步,再键入 $ git config --list 会发现 name 和 email 只有一个值了,这时候就不会报错了。