Programming

한 명의 사용자가 수정 한 모든 파일을 git에게 알려줄 수 있습니까?

procodes 2020. 6. 28. 21:33
반응형

한 명의 사용자가 수정 한 모든 파일을 git에게 알려줄 수 있습니까?


git은 모든 커밋에서 한 사용자가 수정 한 모든 파일 목록을 제공하고 싶습니다.

나의 특별한 유스 케이스는 루비 온 레일즈 프로젝트의 i18n에 관여했으며 이미 수행 된 파일과 수행해야 할 파일을 알고 싶습니다. 문제의 사용자는 나머지 코드 기반이 아닌 i18n에서만 작업을 수행했습니다. 따라서 정보는 모두 git에 있어야하지만 정보를 얻는 방법을 잘 모르겠습니다.


이것이 유일한 방법은 아니지만 작동합니다.

git log --pretty="%H" --author="authorname" |
    while read commit_hash
    do
        git show --oneline --name-only $commit_hash | tail -n+2
    done | sort | uniq

또는 한 줄로 :

git log --pretty="%H" --author="authorname" | while read commit_hash; do git show --oneline --name-only $commit_hash | tail -n+2; done | sort | uniq

이렇게하면 간단한 파일 목록이 표시됩니다.

git log --no-merges --author="Pattern" --name-only --pretty=format:"" | sort -u

필요에 따라 --committer로 --author를 전환하십시오.


시도하십시오 git log --stat --committer=<user>. --committer=옵션 에 사용자 이름을 입력하십시오 (또는 --author=적절하게 사용하십시오 ).

이것은 커밋 당 모든 파일을 뱉어 내므로 중복이있을 수 있습니다.

참고 URL : https://stackoverflow.com/questions/6349139/can-i-get-git-to-tell-me-all-the-files-one-user-has-modified

반응형