网站编程培训学校招生,有域名怎么建网站南宁,中国纪检监察报社长,做网站的网站#x1f4e2;#x1f4e2;#x1f4e2;#x1f4e3;#x1f4e3;#x1f4e3;哈喽#xff01;大家好#xff0c;我是「奇点」#xff0c;江湖人称 singularity。刚工作几年#xff0c;想和大家一同进步#x1f91d;#x1f91d;一位上进心十足的【Java ToB端大厂领…哈喽大家好我是「奇点」江湖人称 singularity。刚工作几年想和大家一同进步一位上进心十足的【Java ToB端大厂领域博主】喜欢java和python平时比较懒能用程序解决的坚决不手动解决✨ 如果有对【java】感兴趣的【小可爱】欢迎关注我❤️❤️❤️感谢各位大可爱小可爱❤️❤️❤️————————————————如果觉得本文对你有帮助欢迎点赞欢迎关注我如果有补充欢迎评论交流我将努力创作更多更好的文章。今天想把之前python写的相关的文档操作的代码提交到码云进行托管但是谁知道在init本地仓库的时候没有注意目录导致本地仓库创建错了同时并提交了这个到远程仓库等我在最外层重新创建仓库并进行提交到时候发现报错了具体的报错如下虽然只是一个简单问题这里对于像我一样不熟悉git的小白来说记录一下方便大家。git push origin master -fhint: Using master as the name for the initial branch. This default branch namehint: is subject to change. To configure the initial branch name to use in allhint: of your new repositories, which will suppress this warning, call:hint: hint: git config --global init.defaultBranch namehint: hint: Names commonly chosen instead of master are main, trunk andhint: development. The just-created branch can be renamed via this command:hint: hint: git branch -m nameInitialized empty Git repository in /Users/ligang/PycharmProjects/pdfProject/.git/(venv) ligangligangdeMacBook-Pro pdfProject % git add ./warning: adding embedded git repository: excelhint: Youve added another git repository inside your current repository.hint: Clones of the outer repository will not contain the contents ofhint: the embedded repository and will not know how to obtain it.hint: If you meant to add a submodule, use:hint: hint: git submodule add url excelhint: hint: If you added this path by mistake, you can remove it from thehint: index with:hint: hint: git rm --cached excelhint: hint: See git help submodule for more information.报错的意思是我之前已经到远程仓库提交过了需要到一个新的仓库进行提交由于我不想重新创建远程仓库 所以将本地错的仓库删除之后使用强制覆盖的方法实现了正确的提交如果我们确定远程分支上那些提交都不需要了那么直接git push origin master -f强行让本地分支覆盖远程分支。。。这个简单的解决了我的方法但是在开发过程中需要使用下面的方法但是在开发过程中需要使用下面的方法但是在开发过程中需要使用下面的方法远程分支上存在本地分支中不存在的提交往往是多人协作开发过程中遇到的问题可以先fetch再merge也就是pull把远程分支上的提交合并到本地分支之后再push。入如果pull有这个报错fatal: refusing to merge unrelated histories 此项错误是由于本地仓库和远程有不同的开始点也就是两个仓库没有共同的 commit 出现的无法提交。这里我们需要用到 --allow-unrelated-histories。也就是我们的 pull 命令改为下面这样的git pull origin master --allow-unrelated-histories如果设置了默认分支可以这样写git pull --allow-unrelated-histories今天的分享就到这里