0

I am working on a project called "wonaco". In this folder, from locally, I have pulled the master branch and created a new dev branch and checkout to that dev branch.

Now, I run this command:

git add .
git commit -m "First Commit"
git push origin dev

but I got the notice:

fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

I need to push my code to the dev branch.

Shibbir
  • 1,963
  • 2
  • 25
  • 48
  • 1
    did you set up a remote? Try `git remote` and post the output – Daemon Painter Nov 18 '20 at 10:43
  • output is empty – Shibbir Nov 18 '20 at 10:44
  • Did you "make sure you have the correct access rights and the repository exists"? – Thomas Nov 18 '20 at 10:44
  • Don't forget to start ssh-agent and add your keys to your github-account. I voted to close the question since there are many suggestions to your question you can investigate first. – kometen Nov 18 '20 at 10:45
  • Does this answer your question? [Git push: "fatal 'origin' does not appear to be a git repository - fatal Could not read from remote repository."](https://stackoverflow.com/questions/32238616/git-push-fatal-origin-does-not-appear-to-be-a-git-repository-fatal-could-n) – Gino Mempin Nov 18 '20 at 10:46

1 Answers1

6

You haven't set up a remote.

run git remote add origin <URL to remote repo>, then try to push again.

Daemon Painter
  • 3,208
  • 3
  • 29
  • 44
  • Its working now :) – Shibbir Nov 18 '20 at 10:56
  • I got this notice : `Writing objects: 100% (14545/14545), 25.47 MiB | 29.00 KiB/s, done. Total 14545 (delta 4300), reused 12575 (delta 4176) error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) fatal: the remote end hung up unexpectedly fatal: the remote end hung up unexpectedly Everything up-to-date ` – Shibbir Nov 18 '20 at 11:04
  • @Shibbir This is a separate issue, most likely due to files too large and remote closing the connection prematurely. You'll find a couple of questions in SO by searching "the remote end hung up unexpectedly". Please accept the answer if this solved your issue – Daemon Painter Nov 18 '20 at 12:36