0

In VS Code terminal git remote repository url are configured properly but when I tried to do push or pull action, getting the fatal error message

I've installed GitLens extension and able to do normal git operations from VS Code command prompt

Git: fatal: 'git@github.com-name' does not appear to be a git repository

enter image description here

vikramvi
  • 3,312
  • 10
  • 45
  • 68

2 Answers2

1

I could solve this weird VSCode bug with below steps

git remote add origin https://... [ already done ]
git remote show origin # if everything is ok, you will see your remote [ already done ]
git push -u origin master # assuming your are on the master branch. 
//[ This step has solved the problem ]

Reference https://stackoverflow.com/a/43364619/2607372

vikramvi
  • 3,312
  • 10
  • 45
  • 68
  • Just a quick note to say that as of late 2021 the default name that GitHub uses for the main branch is now `main`, so for lots of people the third step will now be `git push -u origin main` – philipnye Jan 27 '22 at 14:29
0

That's due to following reasons :

  1. You may not have initialized the repo properly (and that happens some times)

  2. There's already an existing git file and you might be overwriting it (in this case it's fatal)

These are main causes which I happened to come with.... So, yeah.

alphaX64
  • 71
  • 1
  • 7