【发布时间】:2017-06-13 00:39:05
【问题描述】:
我在 Sublime Text 中从终端打开文件,并使用这样的快捷方式:
$ subl <filename>
...我希望做的是打开我上次 git 提交中更改的所有文件。
我可以看到所有像这样更改的文件:
$ git show --name-only HEAD
commit b2c891f64daab0dc67df5cde9608602c7cde2f7b
Author: Jacob
Date: Fri Jun 9 16:52:05 2017 -0700
start doing some cool stuff; ref 12345
python/deep/hot/Classes.py
python/shallow/cold/features.tmpl
javascript/utility_master.js
...但是这个命令显示了除了文件名本身之外的更多信息。
我想做这样的事情:
$ git show --name-only HEAD | <get the lines out that aren't filenames> | xargs -i subl {}
这需要awk 吗?还是我找不到的其他 git 标志?
【问题讨论】: