不能用vscode提交代码到github

闲聊 · 2023-07-23

正常提交报错:

[heige@archlinux source]$ git push origin main
To github.com:1hei1/haos.git
 ! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'github.com:1hei1/haos.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

使用强制提交

git push -f origin main

输出:

Enumerating objects: 1029, done.
Counting objects: 100% (1029/1029), done.
Delta compression using up to 4 threads
Compressing objects: 100% (993/993), done.
Writing objects: 100% (996/996), 455.53 KiB | 2.85 MiB/s, done.
Total 996 (delta 823), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (823/823), completed with 11 local objects.
To github.com:1hei1/haos.git
 + 32a4049...ec7cdfa main -> main (forced update)

解决

  1. 你好,看完你的博客文章,感觉很不错!希望与你网站首页友情链接
    流量卡知识网
    http://53go.cn/
    专注于移动/联通/电信推出的大流量多语音活动长短期套餐手机卡的相关知识的介绍普及

    听说互换友情链接可以增加网站的收录量,特此来换,如果同意的话就给internetyewu@163.com[微信ganenboy]发信息或者就在此回复下吧!【建站问题也可以一起讨论!】

Theme Jasmine by Kent Liao