java - 我可以重新导入已删除的 .git 文件而不丢失代码吗?

标签 java eclipse git github

我从项目中删除了 .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/

相关文章:

java - Kafka 最近 X 分钟的实时平均值

java - JTextArea 麻烦

php - ubuntu 16升级后带php7.0的Eclipse不会在断点处停止

git - Git 有内置的 SSH 服务器吗?

java - 设置 EditText.setText() 会导致应用程序崩溃

java - 从另一个类将 JFrame 添加到主 GUI 框架

java - 我如何为 JBPM 应用程序设置端到端代码调试

java - 从不同的 Eclipse 插件项目调用类

具有相同名称但大小写不同的文件的 Git rebase 问题

git - 多于一行 git commit 信息