在底部的Git中, John Wiegley建议在一天中运行一个cronjob,调用git stash,然后是git stash apply.我很欣赏每小时(甚至更频繁)拍摄我的作品的快照,但我担心如果文件暂时消失或恢复为HEAD,构建可能会中断.是否有另一种方法可以实现目标,而不会冒这种风险?
你可以这样做:
git branch -f autosave $(git stash create)
Run Code Online (Sandbox Code Playgroud)
这将强制分支autosave更新到新更新的存储对象。git stash create保存但不会触及您的索引和工作树。您可以依靠 reflog 来autosave查找以前的版本,就像 stash 一样。
| 归档时间: |
|
| 查看次数: |
148 次 |
| 最近记录: |