今天学习git遇到的错误


cat@cat MINGW64 ~
$ cd d:

cat@cat MINGW64 /d
$ cd learngit/

cat@cat MINGW64 /d/learngit (main)
$ git remote add origin git@github.com:Doraemon12138/learngit.git  //本地仓库和github进行关联

cat@cat MINGW64 /d/learngit (main)
$ git push -u origin master    //本地库的所有内容推送到远程库上,但这里应该是main,因为git更新了,现在github的默认分支为main
error: src refspec master does not match any
error: failed to push some refs to 'github.com:Doraemon12138/learngit.git'


 

cat@cat MINGW64 /d/learngit (main)
$ git pull // 还要先进行git pull!!!,第一次会出现以下内容

The authenticity of host 'github.com (20.205.243.166)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> main

cat@cat MINGW64 /d/learngit (main)
$ git push -u origin main   //推送成功以后就是这样的
Enumerating objects: 12, done.
Counting objects: 100% (12/12), done.
Delta compression using up to 8 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (12/12), 2.55 KiB | 2.55 MiB/s, done.
Total 12 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To github.com:Doraemon12138/learngit.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值