我不小心通过点击“下载 zip”而不是进行克隆来将存储库下载到新机器上。
我在做了很多更改后注意到,现在我在提交并将新更改推送到 github 时遇到了问题,因为 git repo 未包含在 zip 中。
我能做什么?
谢谢
您可以克隆存储库,但不必“将文件复制到新存储库上”
git clone http://github.com/<user>/<repo>
cd <repo>
Run Code Online (Sandbox Code Playgroud)
使用该git --work-tree选项,您可以在考虑另一个文件夹作为您的工作树的同时在您的 git 存储库中工作:
git --work-tree=/path/to/unzipped/files add .
git status
git commit -m "commit changes from unzipped folder"
Run Code Online (Sandbox Code Playgroud)