git问题报错:# hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte

hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte

把本地仓库的东西push到远程仓库时报错:
在这里插入图片描述
很多人说是因为本地仓库的文件和远程仓库不一样,所以要先用命令git pull -f origin master将远程仓库的文件拉到本地:
在这里插入图片描述

可是这样做之后再git push还是没有用,还是报同样的错误。
于是我就用git push -f origin master强制push就成功了。(注意:大家千万不要随便用-f的操作,因为f意味着强制push,会覆盖掉远程的所有代码!)
在这里插入图片描述

posted @ 2020-09-05 08:33  一只小白呀  阅读(218)  评论(0编辑  收藏  举报