1、楼主还是像平常一样快快乐乐得写完了代码,准备同步到git上面,
git add .
git commit -m "更新"
git push
然后就报错了,通过查阅资料发现报错原因是本地代码仓库和远程代码仓库不同步造成的。
2、报错信息:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/momojian/gophish.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
3、解决办法:
同步本地仓库。
$ git pull --rebase https://github.com/XXX.git
上传最新代码。
git push -u origin master