version-controlgithub-desktop

Why is Github desktop creating a new folder rather than using the one I specified when creating a new local repo?


I am looking to do something I thought was pretty simple... I have an existing folder (with project files) on my desktop that I would like have tracked by Github desktop for purposes of source/version control. It seems straightforward... I go to github desktop, select that I'd like to create a new repository, and point it at the folder on the desktop. Here is what I expect to happen:

Instead, this is what I get:

I am not sure why this is happening and it is very frustrating. It looks to me like I have only two options here:

  1. Cut and paste Project files into New folder with specified git repo name
  2. Cut and paste .git folder and .gitattributes out of New folder with specified git repo name and into Project folder, delete New folder with specified git repo name, remove the new repo in Github Desktop when it says it can't find it, and "Add Existing repo" in Github Desktop and point it at Project folder.

Both of these approaches sort of feel like hacks and I am not sure what consequences, if any, may negatively impact my version control intention as a result. Is this a common problem? What should I do?


Solution

  • I wouldn't use github desktop to make your repository. If you don't have it already try installing git bash, a command line interface, and initialize git from there.

    1. Find your existing folder and move to it using cd <folder name here> if you go into the wrong place use cd .. to move out/back one folder

    2. When in your folder use git init to initialize git(the version control software)

    3. Open GitHub Desktop once again and hit "add" then "add existing repository" finally "choose" and find your file in your file explorer