我不小心通过点击“下载 zip”而不是克隆来设法将存储库下载到新机器上。
我注意到在我做了很多更改之后,现在我在提交新更改并将新更改推送到 github 时遇到问题,因为 git 存储库未包含在 zip 中。
我能做什么?
谢谢
最佳答案
您可以克隆存储库,但不必“将文件复制到新存储库”
git clone http://github.com/<user>/<repo>
cd <repo>
使用 git --work-tree
选项,你可以在你的 git 仓库中工作,同时考虑另一个文件夹作为你的工作树:
git --work-tree=/path/to/unzipped/files add .
git status
git commit -m "commit changes from unzipped folder"
关于Git:下载 zip 而不是克隆,现在无法提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34973283/