如何git push到Github的main分支
Github上新建的仓库只有一个main分支,也是默认分支。新创建完的仓库会有一个页面,引导用户将本地文件或仓库push到Github上。 如果是正在开发中的项目,已经有一些本地文件,需要本地初始化仓库并push到远程,按照引导页面提交会遇到一个错误,导致push失败。 $ git push -u origin main To https://github.com/xiaoheige/VRTemplateUE53.git ! [rejected] main -> main (fetch first) error: failed to push some refs to 'https://github.com/xiaoheige/VRTemplateUE53.git' hint: Updates were rejected because the remote contains work that