将本地项目关联到gitlab上
##1.本想项目git init
2.切换分支:git checkout -b dev
3.关联远程gitlab:git remote add origin git@118.190.65.73:province/henan/agent/corba/eventcollector-corba.git
4.关联分支: git branch --set-upstream-to=origin/dev
$ git push origin dev
To 118.190.65.73:province/henan/agent/corba/eventcollector-corba.git
! [rejected] dev -> dev (non-fast-forward)
error: failed to push some refs to ‘118.190.65.73:province/henan/agent/corba/eventcollector-corba.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.
出现上面的问题,进行下面的操作就能解决了
5.合并统一commit起点:git pull --allow-unrelated-histories
$ git pull
fatal: refusing to merge unrelated histories