所以我在一个单独的 haml 分支中重构了我在 haml 中的观点。我不小心删除了我的新 haml 视图而不是旧的 erb 视图。
$ git rm app/views/projects/edit.html.haml app/views/projects/new.html.haml .....
所以我做了一个重置
$ git reset HEAD app/views/projects/edit.html.haml app/views/projects/new.html.haml .....
Unstaged changes after reset:
D app/views/projects/_form.html.erb
D app/views/projects/edit.html.erb
D app/views/projects/edit.html.haml
.
.
.
git状态显示
$ git status
# On branch haml
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# deleted: app/views/projects/_form.html.erb
# deleted: app/views/projects/edit.html.erb
# deleted: app/views/projects/edit.html.haml
.
.
.
为了只保留haml文件并获得一个干净的工作目录,我该从哪里开始?
我相信它很简单,但宁愿问也不要让它变得更糟。谢谢