您当前的位置: 首页 >  令狐掌门 git

git fatal: The current branch master has no upstream branch. There is no tracking information for。。。

令狐掌门 发布时间:2020-07-10 23:25:47 ,浏览量:3

       当你在本地创建了仓库,远程也创建了仓库,或者之前和远程做了连接,或者你重装系统了,再次从远程拉取或者push代码时,就会出现如下错误:

        There is no tracking information for the current branch

或者

         fatal: The current branch master has no upstream branch.

        不管是git push, 还是git pull --rebase, 用git remote -v发现也有关联,但也会出现以上问题,解决也很简单,都给了提示,命令如下:

git branch --set-upstream-to=origin/master master

         输入以上命令就可以解决pull或push的问题了。有时还会出现如下

那么需要运行如下两行代码

git pull origin master --allow-unrelated-histories

git branch --set-upstream-to=origin/master master

运行后应该就不会出现上述问题了。

关注
打赏
1688896170
查看更多评论

令狐掌门

暂无认证

  • 3浏览

    0关注

    485博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0856s