**push报错:**gitLab报错failed to push some refs to ‘git@1xxxxxxxxxx.com/xcxVIP.git’;
pull报错:
$ git pull
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
以上是我常见的报错,我根据网上解决办法:尝试了一下:
$ git push origin master
To 192.168.10.241:dongyuna/xcxVIP.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@192.168.xxx.xxxx:xxxx/xcxVIP.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.
结果仍然报错,然后我参考gitLab命令的作用自己分析,不能推送的原因在与本地代码仓库与服务器代码仓库出入太大,而且date日期不同,每次操作都会被拒绝。
解决办法:
先$ git add . 缓存本地更改的文件夹。
然后$ git commit -am “0326” ,这是添加标记。
接着$ git pull origin master, 拉取你想推送到的分支master的内容与本地合并。
最后$ git push origin master,把合并后的本地代码库合推送给服务器的分支master。
成功的提示:
$ git push origin master
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Delta compression using up to 4 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 528 bytes | 528.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0)
To 192.168.10.241:dongyuna/xcxVIP.git
052f60e..8576dca master -> master