简体   繁体   English

Git本地存储库并在硬盘崩溃后恢复文件

[英]Git local repository and recovering files after hard drive crash

I have a local git repository set up on my laptop, and my computer just crashed. 我在笔记本电脑上设置了本地git存储库,而我的计算机刚崩溃。 I have a copy of the repo folder on dropbox, can I recover my files (on a new hard drive ) somehow? 我在保管箱上有一个repo文件夹的副本,我能以某种方式恢复我的文件(在新硬盘上)吗? From my understanding that is not how git works (it stores the version differences locally right?) but I saw some other threads on here and wasn't sure anymore. 根据我的理解,这不是git的工作方式(它在本地存储版本差异吗?),但是我在这里看到了其他一些线程,因此不确定。

Unless the copy on Dropbox is relatively recent (that is, it sync'd the last time you committed in Git), the likelihood of you recovering your most recent changes is zero. 除非Dropbox上的副本是相对较新的(即,它与您上次在Git中提交的时间同步),否则恢复最近更改的可能性为零。

Git is distributed; Git是分布式的; it works powerfully locally, but you do have to have good backups to ensure that it keeps working in that manner. 它在本地功能强大,但是您必须具有良好的备份以确保它以这种方式继续工作。 Syncing the .git folder to Dropbox is fine, but you would want to ensure that it's relatively up to date, and if you can't do that, then you've unfortunately lost your files. 将.git文件夹同步到Dropbox很好,但是您要确保它是相对最新的,并且如果不能这样做,那么很遗憾,您已经丢失了文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM