git 报错 error: failed to push some refs to 的解决办法

需要先改变本地文件

1
2
3
4
5
6
7
echo "# init" >> README.md
git init
git add .
git commit -m "commit"
git branch -M main
git remote add origin git@github.com:weilining/CDN.git
git push -u origin main -f