"repository already exists" -- error when multiple github repository directories have same name

StackOverflow https://stackoverflow.com/questions/17498885

  •  02-06-2022
  •  | 
  •  

Question

I use wampserver on my dev machine and I have my directories like this:

C:\wamp\www\website_1\www
C:\wamp\www\website_2\www

The reason I have it like that is so that I can have files and folders in the website_x directory that are above the www directory, where the www directory is the same as the www directory on my live server.

The problem is that I am trying to add a second repository to github and it doesn't like my folder structure. Github has me specify a folder location and a repository name. Aggravatingly, github appends the repository name onto the folder location, so if I choose:

C:\wamp\www\website_2\www

As the folder location in github, and the repository name as "myrepository", then it changes the folder location to:

C:\wamp\www\website_2\www\myrepository

Which is obviously totally wrong.

The only way to get it to work with my folder structure is to choose this as the folder:

C:\wamp\www\website_2\

And then name the repository "www," which results in the path being:

C:\wamp\www\website_2\www\

This worked fine for one repository, but since two repositories can't have the same name, I'm at an impasse.

I don't understand why github appends the name of the repository onto the file path. This seems really unintuitive, useless, and creates problems like in my case.

How can I get this working without changing the directory structure that I currently use, which is logical and works really well?

Was it helpful?

Solution

You could:

  • clone the two repos anywhere else on your hardrive (C:\GitHub\Repo1a and C:\GitHub\Repo2)
  • make symlink (MKLINK) between:
    • C:\wamp\www\website_1\www and C:\GitHub\Repo1a
    • C:\wamp\www\website_2\www and C:\GitHub\Repo1b

That, or look into Alias and not VirtualHost.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top