-2

I am using Git to upload the code into Gitlab but it's throwing some error which are given below.

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$

Before that I had uploaded the code into my repository. After that I need to create some challenge in cms.securecodewarrior.com for that when I run the below command it gave me the above error.

1-git checkout -b secure

2-git push --all
halfer
  • 19,824
  • 17
  • 99
  • 186
satya
  • 3,508
  • 11
  • 50
  • 130

1 Answers1

0

As the error is stated, there is some code which is not in your local copy. try to pull from the remote repository and merge it with your local copy, Then push again.

Shobi
  • 10,374
  • 6
  • 46
  • 82
  • I did like this first pull from remote and then push it but still same error. – satya Jun 22 '17 at 10:46
  • 1
    if you are sure that the repo contains nothing that you needed, then you can try `git push -f` which will push it forcibly – Shobi Jun 22 '17 at 12:50