
我需要检查上次提交中更改的文件的位置。因为我必须在 Jenkins 上执行此操作,所以应该使用 bash 脚本来完成。这是git whatchanged -n 1
(我想为此使用的命令)的输出
lukas @ leaf (~/workspace/shairweb)
答案1
试试这个方法:
LASTCOMMIT=$(git log -1 --oneline | cut -f1 -d" ")
git diff-tree --no-commit-id --name-only -r $LASTCOMMIT