【发布时间】:2017-06-22 10:34:50
【问题描述】:
我正在使用 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
【问题讨论】:
-
我试过了,但同样的错误信息出现了。
-
你签出了哪个分支?