gitgit-diffgit-status

What's the meaning of 'R087' in git diff 2 commit ids?


I try to find difference of 2 commit ids. When I git diff, it prints change status of files. 'M' means 'modify'. 'D' means 'delete'. 'A' means 'add'. But what does the 'R087' stand for?

git diff  f0d1122b af122334 --name-status 

M       service/user_feature/search_user_feature_redis.h
D       service/user_feature/search_user_feature_tair.cc
A       service/user_feature/user_feature_tair.cc
R087    service/user_feature/search_user_feature_tair.h service/user_feature/user_feature_tair.h
D       thirdparty/easy/BUILD

Solution

  • The R stands for Rename. The 087 is a similarity score: the files before and after were 87% similar according to Git, which is enough for Git to say this was a rename operation with some changes, rather than a deletion of the "old file" and an addition of the "new file".

    By default, the similarity threshold is 50%.

    Reference