简体   繁体   中英

git diff file between two last commits that changed it

Rephrase: I would like to find the two last commits that changed a specific file (or folder, or group of files if possible) and perform a diff between those two commits. All in one command.

Thanks, this is going to save me time when I try to visualise what are the changes in data files that I re-populate with new scripts.

git diff $(git log --format='%H' -2 -- "$path")

path显然是您要检查的文件的路径。

git diff $(git log -2 --oneline -- MyFile.txt | cut -d " " -f 1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM