将GitHub存储库导入到特定文件夹

我有一个通过复制特定文件夹的内容而创建的GitHub存储库。

现在,我已经安装了GitHub Desktop,我想将此目录直接连接到GitHub存储库,而不是重新下载并创建副本。

我该怎么做?

iCMS 回答:将GitHub存储库导入到特定文件夹

在切换到GitHub桌面之前,您应该为该文件夹准备环境,以便链接到远程存储库:

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

然后,您可以打开GitHub Desktop和add a local repository(您刚刚配置的文件夹)

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

本文链接:https://www.f2er.com/1999036.html

大家都在问