Codecademy gave me the check, but the console gave me an NO

Hi, everyone. I’m on the course: deploy a website: github pages: deploy your site

Codecademy gave me the check, which should mean my command was correct, and my website should have been deployed successfully.

But in the console, I get an error, which means that my website wasn’t deployed successfully.

In the console, I typed:

git push -u origin master

And the console gave me back the text:

Username for ‘’:

Then I type my username:

Then the console gave me:

Password for ‘’:

And then I typed my password:


And then, I get all this:

To ! [rejected] master -> master (fetch first)
error: failed to push some refs to ‘
hint: Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes(e.g., ‘git pull …’) before pushing again.See the ‘Note about fast-forwards’ in ‘git push --help’ for details.

What does that even mean? Let alone trying to fix my problem.

Can anyone help?

ps: When this problem is fixed, how do I checkout my deployed website?

Hi. Your issue is that your local repository is not up to date with your online repository. Sometimes this happens to me when I do something as simple as create a readme through the github interface. It isn’t a problem. What you need to do is catch your local repository up to the remote repository. You need to pull with “git pull origin master”. You may be asked to name your commit. If so, it gets kind of confusing. But if that happens, you will type in the commit message and hit enter. This is where it gets confusing. Often, for me, I have to press 'ctrl+c" and then type the message that it promts you, ':qa" or something. When you finish doing that, it will tell you it updated and you’ll be caught up to date on your local repository. You should then be able to set up your login for the CLI.

1 Like

You mean I have to do

git remote add origin


Are you there?

Do you have any ideas?

What I got from this is that master on your remote is ahead of your local branch of master. Did you try bezlonir’s suggestion with pull which would effectively both fetch the updated branch and attempt to merge it? Since this is just the demo that seems like the easiest route.

You could also try using git fetch origin master which would provide you with a local version of this branch (it’d be under origin/master). git diff master origin/master would then show yout the differences between the two if you wanted to know what your were merging ahead of time and then a merge would put you back in the right spot.

Does @bezlonir mean I have to do

git remote add origin


I don’t know what you have and have not done before, I’m assuming your already have origin in your remotes so there’s no need to add it, but the comment doesn’t include any of that. It just suggests using git pull origin master. Note that this will automatically triy to merge with your current commit so make sure you’re all up to date on commits and such (it basically runs both git fetch master and git merge origin/master).

If you don’t have a remote repo configured for push/pull then you’ll get a warning as such and then you’ll know whether or not you’ll need to about adding one but considering what you’ve already posted it appears you’ve already set one up.

1 Like

Where should I put this command?

For that lesson git would be on your path so it’s just a console/terminal command.

I meant should I put in front of

or behind?

I’d highly suggest you actually spend a bit of time looking into how to manage remote repositories or this will all remain extremely confusing. I may be wrong but you seem to be treating it as a series of steps that need to be performed to get from A to B. It would be better if you considered exactly what each of these commands is actually doing or it will remain a black box you’ll be afraid to touch when it comes to actually managing a working repo.

The original warning error gave you enough information to work with, consider exactly what each of these lines is telling you-

“Updates were rejected because the remote contains work that you do not have locally.
This is usually caused by another repository pushing to the same ref.
You may want to first integrate the remote changes(e.g., ‘git pull …’) before pushing again.
See the ‘Note about fast-forwards’ in ‘git push --help’ for details.”

1 Like

@tgrtim where can I have a deep insight to Remote Repositories? Which lecture in Codecademy or other website if can you refer?

There’s a few guides out there but these are the ones I went through first. In particular the ‘three trees’ of git helped me a great deal. For these particular topics I remember going through these particular pages and the two together helped me-

If you run through a couple of examples whilst following these guides you’d wind up with at least a better idea of how the working directory, the staging area and the remote repo all fit together.

However, there are numerous YT vids and such if that’s your preferred method of learning. Defintiely look into the bit about the three trees though because that seems to the standard way of thinking about working with a remote repo.

assuming your repository is named Tommy-Janet.

You should be typing it in your command-line editor. I use git bash. As has been noted, it sounds like you added a remote repository already. So you need to pull from the remote to get caught up. You won’t be able to push until you pull.

@tgrtim and @bezlonir.

This is what I get after useing git pull origin master and then useing git push -u origin master, last typing my username and password:

Counting objects: 29, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (27/27), done.
Writing objects: 100% (29/29), 9.60 KiB | 0 bytes/s, done.
Total 29 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), done.
7bd0241…9800121 master -> master
Branch master set up to track remote branch master from origin.

1 Like

Sounds like it worked. Hopefully, you should be able to set up your cli now.

what does"cli"mean?

@tgrtim and @bezlonir

Why didn’t Codecademy give the lecture of Remote Repositories? Before we can move to the course How to deploy a website, which makes it harder to learn. We prefer to learn it in Codecademy.