【自用】解决Git更新库不成功问题

  1. 取消代理
git config --global --unset https.proxy

成功之后运行原代码,会弹出github登录界面

  1. 更新代码
    在这里插入图片描述
  2. 常用’git --help’ ‘git status’(查看git存储状态)

22.3.7遇到的新问题:
fatal: unable to access ‘https://github.com/xxxxx/xxxxxxxxxxxx.git/’: Failed to connect to github.com port 443 after 2050 ms: Couldn’t connect to server

解决:git SSL certificate problem: unable to get local issuer certificate

最终完整解决方案,附带简单讲解:
https://zhuanlan.zhihu.com/p/193140870

4.问题:error: src refspec master does not match any
error: failed to push some refs to ‘github.com:limboless/AtomImgSCNU_TUcamOnly.git’

解决:
$ git push origin master 修改为 $git push origin main即可正常上传

5.创建库+更新库:
在Github上创建库
复制界面上的引导,例如:
echo “# AtomImgSCNU_TUcamOnly_videoON” >> README.md
git init
git add README.md
git commit -m “first commit”
git branch -M main
git remote add origin git@github.com:limboless/AtomImgSCNU_TUcamOnly_videoON.git
git push -u origin main

找到本地文件夹,右键选择Git Bash here
粘贴复制内容
接下来直接进行更新

更新:
git status
git add *
git commit -m “更新说明”
git pull
git push origin main

6.git还原文件到指定版本,git恢复误删文件,git-checkout
原网址:https://www.bilibili.com/video/BV1gR4y1C7SW/?spm_id_from=333.788&vd_source=714c699ee5363c438114b0b3b66b8ee1
在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值