Git,  Programming

[Git] Commit History에서 크기가 가장 큰 파일 찾기

Git commit history에서 크기가 가장 큰 파일 순으로 찾아야 하는 경우 다음과 같은 명령어로 얻을 수 있다.

#!/bin/bash 
git rev-list --objects --all \
    | grep "$(git verify-pack -v .git/objects/pack/*.idx \
    | sort -k 3 -n \
    | tail -10 \
    | awk '{print$1}')"
aac4fa76b5989e9189e4c224873bbd684b861234 build/standalone/batch_mon-23/sandbox/monaco
238df1280117a31a825220b24a2958cf7eaf8322 build/standalone/studies/testlists/qos/dual_ccm_quad_smc.py
d5a72c98a3f340e5f8a84b48759dd35e0bbf74cf build/standalone/studies/testlists/qos/dualsmc.py
c5719da55c8771b753cedbeccebba13f0b30970c build/standalone/studies/testlists/qos/dualsmc256B.py
91a7886fc729f5d1746d0aeb4de53b69a53b5eec build/standalone/studies/testlists/qos/single_ccm_dual_smc_ht.py
a24982af364b015d36cc7dc375c71feb10542852 build/standalone/studies/testlists/qos/single_ccm_dual_smc_ht4x.py
51eeeb50a3350ac2d99a734865e390d5802dad34 build/standalone/studies/testlists/qos/qbusyqfull.py
c05483bc1eb00e36a9b85ee8792881496c5d21ce build/standalone/studies/testlists/qos_hurry_enabled.py
3a7e521731adb9e053be4f9f145faa6ac0f852f3 build/standalone/studies/testlists/qos_hurry_disabled.py
bbf9fc75ba91c43fac935b5254693e75f257c60c build/standalone/bld-Linux_x86_64-gcc4.7/monaco

수행하게 되면 [hash number] [path] 가 출력된다.

Reference

  1. https://stackoverflow.com/questions/10622179/how-to-find-identify-large-commits-in-git-history

Leave a Reply

Your email address will not be published. Required fields are marked *