Saber2pr's Blog

检查最近1次提交变更内容

获取分支最新的commit:

git rev-parse master

# 获取上一次commit
git rev-parse master^

获取文件变更:

# git diff commit1 commit2
git diff $(git rev-parse master) $(git rev-parse master^)

# 指定文件
git diff $(git rev-parse master) $(git rev-parse master^) src/index.ts