7
项目在本地写了很久,没有 commit 过,今天打开的时候从很早之前的一个 commit 版本打...
source link: https://www.v2ex.com/t/793036
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
今天脑抽,webstorm 打开的时候清了下启动项目那里的缓存,发现代码变成了很久之前的一个版本,git history 是很久之前的了。 能恢复吗?编辑器本身的缓存打开,而不是 git 的某一个版本打开,咋操作?
27 条回复 • 2021-08-02 00:55:41 +08:00
enchilada2020 5 小时 12 分钟前 via Android
@liuzhaowei55 如果写了一半没写完的呢 也要 commit 吗?有点强迫症 每次都想把一个完整的写完 一切都干干净净了再 commit 觉得写了一半像草稿的 commit 之后有记录 心里总有疙瘩。。
Rache1 5 小时 5 分钟前
Local History 也不是万能的 😂
[Local History]( https://www.jetbrains.com/help/webstorm/local-history.html)
> Note that Local History is not a replacement for a proper version control for long-term versioning. Local History is cleared when you install a new version of WebStorm. It also has a [retention period]( https://www.jetbrains.com/help/webstorm/local-history.html#local-history-retention) and maximum size, so revisions are not guaranteed to persist.
[Local History]( https://www.jetbrains.com/help/webstorm/local-history.html)
> Note that Local History is not a replacement for a proper version control for long-term versioning. Local History is cleared when you install a new version of WebStorm. It also has a [retention period]( https://www.jetbrains.com/help/webstorm/local-history.html#local-history-retention) and maximum size, so revisions are not guaranteed to persist.
512357301 5 小时 3 分钟前 via Android
@enchilada2020 commit 的目的就是记录你的思路,开源嘛,让别人也能知道你的代码变动过程。
一次性完整写完再 commit 大可不必,一次性完整写完我觉得那应该叫发版或者大版本,这里面肯定应该有无数个小版本来支撑的
一次性完整写完再 commit 大可不必,一次性完整写完我觉得那应该叫发版或者大版本,这里面肯定应该有无数个小版本来支撑的
forgottencoast 3 小时 53 分钟前 1
@enchilada2020
搞一个开发分支,弄好了,合并成一个 commit 也可以解决有强迫症的问题。
正常是每次完成一个小改动就 commit 。
中途的临时保存可以用 stash,这个不是 commit 。
搞一个开发分支,弄好了,合并成一个 commit 也可以解决有强迫症的问题。
正常是每次完成一个小改动就 commit 。
中途的临时保存可以用 stash,这个不是 commit 。
CEBBCAT 3 小时 8 分钟前
听起来有点不合理,是不是打开错项目了?不然的话我怀疑是你没有描述清楚,Intellij 这些都是有自动保存的,比如窗口失焦,更别说关闭程序了。
清理缓存不可能把代码都清理掉的
清理缓存不可能把代码都清理掉的
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK