Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Working With Remote Repositories GitHub

Hannah Gaskins
Hannah Gaskins
14,572 Points

unable to push to github

I am unable to push my_really_cool_project to my github repository. When using the command

$ git push origin https://github.com/hnag409/my_really_cool_project.git

The following appears:

 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/hnag409/my_really_cool_project.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.

Not sure what is going on here, but any advice/direction would be lovely!

:)

2 Answers

The error message is showing that there is content in the repository that you don't have locally. I believe you have to pull first, resolve any conflicting issues that may arise and only then push your changes.

Did you get this resolved? I'm having the same issue.