programing

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

yellowcard 2023. 11. 1. 22:16
반응형

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

나는 모든 커밋에 걸쳐 한 사용자가 수정한 모든 파일의 목록을 나에게 주고 싶습니다.

저의 특별한 사용 사례는 루비 온 레일 프로젝트의 i18n에 참여한 적이 있는데, 우리는 어떤 파일이 이미 수행되었는지, 어떤 파일이 여전히 수행되어야 하는지 알고 싶습니다.해당 사용자들은 i18n에 대해서만 작업을 했고, 나머지 코드 베이스에 대해서는 작업을 하지 않았습니다.그래서 그 정보는 모두 입력이 되어야 하는데, 어떻게 빼낼지 잘 모르겠습니다.

그러면 파일 목록이 간단히 표시되며, 다른 파일은 표시되지 않습니다.

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

필요에 따라 --commiter에 대한 --작성자를 전환합니다.

이것만이 유일한 방법은 아니지만, 효과는 있습니다.

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 --stat --committer=<user>. 그냥 사용자 이름을 위에 올려놓기만 하면 됩니다.--committer=옵션(또는 사용)--author=적절한 경우).

이렇게 하면 커밋당 모든 파일이 삭제되므로 중복이 발생할 수 있습니다.

git log --pretty= --author=@abcd.com --name-only | sort -u | wc -l

회사별로 변경된 모든 파일을 깃레포에 표시합니다.

git log --pretty= --author=user@abcd.com --name-only | sort -u | wc -l

모든 수정된 파일을 git repo에서 작성자 이름 'user'로 표시합니다.

파일 이름 목록만 원하는 경우:

git log --author= --pretty= 형식:%h | xargsgit diff --name-only | sort | uniq

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

반응형