Skip to content

Git problems when 'YOUR_GITHUB_ACCOUNT' is not replaced #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thomasbakp opened this issue Apr 7, 2015 · 7 comments
Closed

Git problems when 'YOUR_GITHUB_ACCOUNT' is not replaced #58

thomasbakp opened this issue Apr 7, 2015 · 7 comments

Comments

@thomasbakp
Copy link

In the first GIT chapter when I enter command git push -u origin master I get: remote: Repository not found.
fatal: repository 'https://github.com/YOUR_GITHUB_ACCOUNT/learn-rails.git/' not found
I have entered name and password in GIT but the first time I accidentally entered the line with YOUR_Github_account....
Does this has anything to do with that now the Repository not found?

@DanielKehoe
Copy link
Member

That could be the problem. Fix the name in Git and please report back if that resolves the issue.

@thomasbakp
Copy link
Author

I did fix the name in GIT but no change...hmmm. What is it that I am not seeing.

It seems something is missing in the manual.
It's like GIT remember my first mistake of account name and therefore it cannot push it to github.

Then I get:
remote: Repository not found.
fatal: repository 'https://github.com/YOUR_GITHUB_ACCOUNT/learn-rails.git/' not found

@DanielKehoe
Copy link
Member

Did you resolve this issue?

@thomasbakp
Copy link
Author

Yes. I erased previous installed version of learn-rails and started over.
However I couldnt push with command: git push -u origin master.
I got:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/thomasbakp/learn-rails.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.

I checked stackoverflow and used: git push origin +HEAD
And it pushed the code.
Maybe you want to use it for the updated version of your book?

@DanielKehoe
Copy link
Member

I've mentioned this problem in the newest edition of the book and linked back here.

@DanielKehoe DanielKehoe changed the title Git problems Git problems when 'YOUR_GITHUB_ACCOUNT' is not replaced Jun 1, 2015
@Massiff
Copy link

Massiff commented Apr 19, 2017

In my case problem was in missed step on creating repo in my github account.

@DanielKehoe
Copy link
Member

Here's what you need to know.

If you blindly copy and paste the command shown in the book:

git remote add origin https://github.com/YOUR_GITHUB_ACCOUNT/learn-rails.git

You have told git that there is a repo named YOUR_GITHUB_ACCOUNT on GitHub.

So try this:

$ git remote show
origin
$ git remote remove origin
$ git remote show

That will reverse the problem you created. Then you can go back to the book and follow the steps again to add GitHub as a remote repository for your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants