! [rejected]        main -> main (fetch first)
error: failed to push some refs to

 git push出现报错,也无法打开git hub页面

命令行直接使用命令

git fetch origin master:tmp

会出现报错不必理会

git rebase tmp

error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.

命令继续输入即可

git push origin HEAD:master
git restore----恢复文件原来的版本
git restore
git show  显示文件内容
git clone 第一次从远程获取文件
git pull 在不断完善,从远程获取协作的文件