我大概是傻了吧,昨天脑袋一热把虚拟机的linux系统还原了,完全忘记搭在上面的git,然后eclipse工作空间的代码也没了。。。正好今天纪念一下我从本地暂存找回工程。

  • 先说正常的:如果你的git还在,工程也还在,正常更新代码即可:右键---Team--Pull

 git的eclipse使用(二)——导入工程

注意:Commit提交的作用是把代码提交到本地。

          Push的作用是把本地的代码提交到远程的git服务器。

          Pull是从git服务器下载最新的代码


  • 如果你需要在完全新的工作空间导入,克隆git仓库到本地:
1.

git的eclipse使用(二)——导入工程

2,git的eclipse使用(二)——导入工程

git的eclipse使用(二)——导入工程

git的eclipse使用(二)——导入工程

 设置git文件存放路径

git的eclipse使用(二)——导入工程

导出工程

git的eclipse使用(二)——导入工程

git的eclipse使用(二)——导入工程

git的eclipse使用(二)——导入工程

转换工程为对应的类型,Maven工程就选择convert to Maven project

git的eclipse使用(二)——导入工程

  • 如果你像现在的我一样,徒有几个空工程没有代码,有没有git服务器,只能试图从本地暂存找回代码:

git的eclipse使用(二)——导入工程

把之前的空工程都删掉,在空白区域右键:

git的eclipse使用(二)——导入工程

git的eclipse使用(二)——导入工程

git的eclipse使用(二)——导入工程

git的eclipse使用(二)——导入工程

可以看到刚才导入的工程及其子工程就完全导入了。

这时再把它们提交到git服务器就好了。

相关文章:

  • 2021-03-31
  • 2022-12-23
  • 2021-12-12
  • 2021-11-01
  • 2021-11-19
  • 2022-01-15
  • 2021-05-31
  • 2022-01-07
猜你喜欢
  • 2021-11-19
  • 2021-10-03
  • 2022-01-08
  • 2021-09-29
相关资源
相似解决方案