0

I am having this wierd issue with Git. This is what I did:

  • I created a new project in VS Community 2017
  • From Git Bash, I did git init in the root directory of my new created project
  • I added new files and did some coding
  • I created a new repository MVVM_Template (same as the local project name) on my github account
  • I followed the instructions in Adding an existing project to GitHub using the command line

Result:

Me@MyPC MINGW64 ~/source/repos/MVVM_Template (master)
$ git remote add origin https://github.com/MeOnGithub/MVVM_Template.git
fatal: remote origin already exists.

Me@MyPC MINGW64 ~/source/repos/MVVM_Template (master)
$ git push -u origin master
remote: Repository not found.
fatal: repository 'https://github.com/MeOnGithub/MVVM-Template.git/' not found

So remote origin already exists, but Repository not found.

How can I resolve this?

Sandra K
  • 1,209
  • 1
  • 10
  • 21

1 Answers1

1

I think you've spelled something wrong? Looks like the actual repository has a different name than what you've set the remote to. Is it MVVM_Template or MVVM-Template?

  • it is underscore and not dash, both local and on the repository. but it errors out as dash. hmm I will try remove it. Thanks for pointing it out. – Sandra K Feb 24 '18 at 00:54
  • I removed dashes and underscores, and it worked. This was very weird and thanks. – Sandra K Feb 24 '18 at 01:14
  • It should definitely work with dashes or underscores. If you were typing by hand, I suspect you may have accidentally used a dash when you initially did `git remote add origin`. Anyway, I'm glad you resolved this! – user9403944 Feb 24 '18 at 01:16
  • https://stackoverflow.com/questions/48958546/can-i-create-a-new-repository-out-of-an-existing-repository-but-rename-it Maybe you can help? :) – Sandra K Feb 24 '18 at 01:48
  • Don't have enough rep to comment on your other post. It would be helpful if you can elaborate on "I have not succeeded yet." Where did you get stuck? What errors did you run into? You don't mention setting remotes for the CoffeeMaker repo – user9403944 Feb 24 '18 at 01:54
  • I got stuck in renaming, when I rename the solution then the project. It fails to build. And if I close VS, rename from explorer, then open project. It fails to load project (says solution has 0 project and prompts an error saying some files did not load correctly). If my approach is wrong, what is the best approach to create new local/remote stuff based on existing repository but with a new name? – Sandra K Feb 24 '18 at 02:11
  • Looks like an issue with renaming Visual Studio projects, rather than a git issue. Sorry, but I know nothing about VS! I would tag your post with visual studio as well. As far as git is concerned, the only additional thing you need to do is set the cloned repo's remote to `https://github.com/MeOnGithub/CoffeeMaker` (or whatever the url is) – user9403944 Feb 24 '18 at 02:18