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 Introduction to Git GitHub and Other Remote Repositories Pushing Commits to GitHub

Spencer Renfro
PLUS
Spencer Renfro
Courses Plus Student 11,133 Points

git push -u not working

this is the message I get when I use git push -u

error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:rifraf94/medals.git'

Below is the full code I ran if i made errors before the git push -u command.

treehouse:~/workspace$ git init
Reinitialized existing Git repository in /home/treehouse/workspace/.git/
treehouse:~/workspace$ git remote add origin https://github.com/rifraf94/medals.git
fatal: remote origin already exists.
treehouse:~/workspace$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:rifraf94/medals.git'

1 Answer

I believe GitHub has replaced the name "master" with "main": https://github.com/github/renaming

Have you tried running your code again using "main" instead of "master"?