1

I have tried just about everything I believe. change from SSH to HTTPS, making sure to commit, I have been search for hours and still to no avail after trying everything. My terminal output is below. I am sure it is a simple fix because my friend has successfully created a repo in GitHub and pushed to it on my device, but I do not remember what she did differently, and alas, I am no longer in contact with her.

$ git init
Reinitialized existing Git repository in 
/home/alexander/Dropbox/projects/GroupProject/.git/
$ git add .
$ git commit -m "second test"
On branch master
nothing to commit, working directory clean
$ git push -u origin master:master
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
phd
  • 82,685
  • 13
  • 120
  • 165
baldguy99
  • 21
  • 3
  • 1
    Do you realize you don't have 1. created any remote, 2. created any github repository? – Arount Feb 15 '18 at 16:37
  • Possible duplicate of [Git Push ERROR: Repository not found](https://stackoverflow.com/questions/10116373/git-push-error-repository-not-found) – phd Feb 15 '18 at 19:57

1 Answers1

1

You type

git push -u origin master

(remove the :master)

That means that you want to send something to the server origin. You have not setup such a server from the log you show.

To see which server you setup go ahead and type git remote -v

You should see nothing since you have not yet setup something.

You want to add the GitHub repo that your friend setup as your origin.

To do that type the link of your friends repo. Something like

git remote add origin <remote repository url of your friends repo>

See https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ for more info.

Once you have added origin you probably want to do git pull origin master to get the code.

However, to have everything setup for you just do git clone <repo from your friend>. That way the remote origin is setup for you.

Good luck!

Mr.Christer
  • 692
  • 1
  • 10
  • 12