使用Git推送代码时出错
我正在使用Git将代码上传到Gitlab,但它抛出了一些错误,如下所示使用Git推送代码时出错,git,gitlab,Git,Gitlab,我正在使用Git将代码上传到Gitlab,但它抛出了一些错误,如下所示 subrajyoti@subrajyoti-H81M-S:/opt/lampp/htdocs/MeetingRoomBooking/mrb_correct$ git push --all Password for 'https://Subhraj@git-cms.securecodewarrior.com': To https://Subhraj@git-cms.securecodewarrior.com/Subhraj/
subrajyoti@subrajyoti-H81M-S:/opt/lampp/htdocs/MeetingRoomBooking/mrb_correct$ git push --all
Password for 'https://Subhraj@git-cms.securecodewarrior.com':
To https://Subhraj@git-cms.securecodewarrior.com/Subhraj/Meeting-room-booking.git
! [rejected] secure -> secure (fetch first)
error: failed to push some refs to 'https://Subhraj@git-cms.securecodewarrior.com/Subhraj/Meeting-room-booking.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.
subrajyoti@subrajyoti-H81M-S:/opt/lampp/htdocs/MeetingRoomBooking/mrb_correct$
在此之前,我已将代码上载到我的存储库中。之后,我需要在cms.securecodewarrior.com中创建一些挑战,当我运行下面的命令时,它给出了上面的错误
1-git checkout -b secure
2-git push --all
正如错误所述,有些代码不在本地副本中。
尝试从远程存储库中提取并将其与本地副本合并,然后再次推送。可能重复的可能重复的可能重复的我尝试了,但出现了相同的错误消息。您签出了哪个分支?我确实喜欢先从remote拉,然后再推送,但仍然是相同的错误。如果您确定回购协议不包含任何您需要的内容,则可以尝试git push-f,它将强制推送