0

Trying to push a committed file to an existing remote repository on GitHub. Below I verified and I'm trying to push to the Django. I've tried git push, and git push -u Django master. Any help would be appreciated. I have been saving all of my files locally and I am now adding all to GitHub and it's a little confusing.

Roberts-MBP:Django robertamato$ git remote -v
Django  https://github.com/CodingDojo-Python-09-04/Robert_Amato.git (fetch)
Django  https://github.com/CodingDojo-Python-09-04/Robert_Amato.git (push)
origin  https://github.com/CodingDojo-Python-09-04/RobertAmato (fetch)
origin  https://github.com/CodingDojo-Python-09-04/RobertAmato (push)
Roberts-MBP:Django robertamato$ 

Here is a error code it threw, I see it suggests to fetch first but I'm not to familiar with how that process works.

Roberts-MBP:Django robertamato$ git push -u Django master
To https://github.com/CodingDojo-Python-09-04/Robert_Amato.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/CodingDojo-Python-09-04/Robert_Amato.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.
Robert Amato
  • 59
  • 1
  • 2
  • 6
  • 1
    Possible duplicate of [Github "Updates were rejected because the remote contains work that you do not have"](https://stackoverflow.com/questions/18328800/github-updates-were-rejected-because-the-remote-contains-work-that-you-do-not-h) – sebastian-c Sep 08 '17 at 15:47
  • The error is telling you that the remote repository contains some files or changes you do not have yet. You need to first grab those files before you can push your changes onto the remote repository. Use something along the line [of this answer](https://stackoverflow.com/a/18442755/1377895) – Roman Vottner Sep 08 '17 at 15:48
  • @sebastian-c that did the trick – Robert Amato Sep 08 '17 at 16:11

0 Answers0