Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Git推送代码时出错_Git_Gitlab - Fatal编程技术网

使用Git推送代码时出错

使用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/

我正在使用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/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,它将强制推送