ubuntu 中 git push -u origin failed

1. 报错

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.

2. 解决方案

终端输入:
git pull origin XX --allow-unrelated-histories
git add -A
git commit -m “内容"
git push -u origin XX


版权声明:本文为qq_39748202原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。