git使用技巧
一、查找两个版本之间的不同
git diff sha1 sha2 --stat --diff-filter=A --name-only -- '*.h'
--stat 只显示基础信息,而不是文件具体变化内容
--diff-filter=A 只显示Added(新增文件的变化)
--name-only 只显示文件名
-- '*.h' 只显示某种扩展名文件
二、查找某个用户所有新增文件汇总
git log --author="用户名" --name-status --diff-filter=A --format='> %aN' | awk '/^>/ {tagline=$0} /^A\t/ {print tagline "\t" $0}'
浙公网安备 33010602011771号