git用第二种方法指令: git push -u origin main 会报错
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/favoriteor/text.git'
然后使用git branch main(git branch main 表示创建一个叫main的分支)
在使用:git push -u origin main(git push -u origin main表示把创建的main分支推送到远程仓库)
就好了,就成功上传到远程仓库了。