我从项目中删除了 .git 文件。但是,我还没有删除我的项目文件夹。我仍然可以仅导入 .git 文件而不重新导入整个项目吗?
我还没有尝试过任何不想在删除文件夹并重新导入完整项目时丢失代码的操作
最佳答案
要从系统中恢复文件/文件夹,您需要寻找一些恢复工具。
但以下是一些步骤,您可以如何安全地保存未投入的精力:
1- clone your project into another folder.
2- you will have the latest code with
.git
stuffs.3- copy paste all files from old folder to new.
4- now you have overwritten only those files which are having change.
5- run
git status
to see the efforts intact.
或者:
1- clone your project into another folder.
2- you will have the latest code with
.git
stuffs.3- copy paste all
.git
stuffs from new folder to older.4- now you have
git
back into your project.5- run
git status
to see the efforts intact.
关于java - 我可以重新导入已删除的 .git 文件而不丢失代码吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58516295/