尝试了解 Git 的工作原理
我刚刚安装了 eGit 插件并且正在使用它。我是 Git 新手。
我注意到一些奇怪的事情:
我提交了示例项目“Planets”,然后我只修改了一个文件 Planet.java。
然后我查看了 Git 存储库文件夹,修改后的文件 Planet.java 就在那里,但我的其他源文件都没有。
这是否意味着如果我从磁盘中删除原始项目文件夹,就会破坏 Git?我的意思是我将无法再恢复该项目之前提交的任何版本吗?
I just installed eGit plugin and I'm playing around with it. I'm new to Git.
I've noticed something strange:
I committed sample project "Planets" then I modified one file only Planet.java.
Then I looked in the Git repository folder, and this modified file Planet.java is there, but none of my other source files are.
Does this mean if I delete my original project folder from the disk, it will break Git? I mean will I not be able to restore any previous committed version of this project anymore?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“原始项目文件夹”是您的 Git 存储库。 Git 仅存在*于您执行 git init 的目录中。有关文件的元数据存储在项目目录内的隐藏
.git
目录中。如果删除项目目录,您将删除 Git 存储库的本地副本。*假设您还没有显式克隆您的存储库
The "original project folder" is your Git repository. Git only exists* within the directory where you performed a
git init
. Its metadata about your files is stored within a hidden.git
directory inside your project directory. If you delete your project directory, you're deleting your local copy of the Git repository.*Assuming you haven't explicitly cloned your repository