-2

I have an error named in the title.

fatal: pathspec 'origin' did not match any files

It happened when I tried to change remote repository from new to old one. There are no changes comparing with old version. Last commits are same in local and remote repositories.

I used git add origin command.
It was my mistake in command.

Does anybody have such problem? How to solve it?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Cherik
  • 31
  • 1
  • 5
  • 3
    what command exactly did you try to run? – Mureinik Mar 01 '23 at 12:29
  • 2
    Paste the command in the question, please, not as a comment. – eftshift0 Mar 01 '23 at 12:31
  • Does this answer your question? [Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git](https://stackoverflow.com/questions/5989592/git-cannot-checkout-branch-error-pathspec-did-not-match-any-files-kn) – Eng_Farghly Mar 01 '23 at 13:04

1 Answers1

-1

I used git add origin command

git add is for adding files.

git remote add is for adding remote URL:

git remote add origin https://....
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250