Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

This directory does not appear to be a git repository

Tags:

git

github

I have factory reset my computer, and before that, I had my github repositories synced locally to remotely. Now I am trying to add a local repository and it keeps showing: This directory does not appear to be a git repository. All repositories did this. I pasted in the .gitattributes file in, they are all in a file github, and creating a new local repository worked. GitHub Desktop not adding local repository

Here is what it looks like after I created a new repository for one of the repositories online that I had, and tried linking them with the URL: Repository Settings not showing URL option

It did not show the URL option. Publishing doesn't work because it already exists on GitHub.

like image 838
Marvin Avatar asked Aug 03 '18 01:08

Marvin


1 Answers

Instead of adding an existing folder, you should clone your repo to a new one, and start working from said new clone.

See GitHub Desktop cloning a repository.

But if you want to use your existing folder as a local repo of an existing remote repo, follow desktop/desktop issue 2883

  • Drag an ordinary folder into the app (or use Add Local Repository and choose the folder)
  • You'll get a message saying "This directory does not appear to be a Git repository. Would you like to create a repository here instead?" and the "Add Repository" folder is disabled
  • Click "create a repository here"
  • Select the "Repository -> Repository Settings... -> Remote" option. Enter the URL of your remote repo.
like image 60
VonC Avatar answered Dec 03 '22 19:12

VonC