Importing GitHub repository into a specific folder

Viewed 154

I have a GitHub repository that I've created by copying content of a specific folder.

Now I have installed GitHub Desktop and I would like to directly connect this directory to my GitHub repository instead of re-downloading and creating a copy.

How can I do this?

1 Answers

Before switching to GitHub Desktop, you should prepare the environment for that folder, in order to be linked to the remote repository:

cd /local/path/to/folder
git init .
git remote add origin https://github.com/<me>/<myRepo>
git fetch
git switch -m master

Then you can open GitHub Desktop and add a local repository (the folder you just configured)

https://docs.github.com/assets/images/help/desktop/add-local-repository-windows.png

Related