【git-bug累计】实践中git命令出现的问题总结

1.error: failed to push some refs to 'https://github.com/xx.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因:远程分支和本地分支不一样,这样一种操作最会出现,萌新的时候,在github创建了一个仓库,也顺利clone到了本地
但因为任性删除了远程分支的master也就是强制删除了仓库,当你再创建一个项目准备把本地项目提交上去的时候就会出现这种情况
解决拌饭:
第一种
git fetch
git rebase
第二种
确保远程仓库没有你要的文件, git push origin master -f(强制覆盖远程仓库的文件)

猜你喜欢

转载自www.cnblogs.com/cyCalf/p/10708513.html