콘텐츠로 이동

레시피: Git 워크플로

yaku는 stdin 파이프를 통해 git 출력과 잘 작동합니다. 다국어 팀을 위한 일반적인 워크플로를 소개합니다.

Terminal window
# 최근 10개 커밋
git log --oneline -10 | yaku --to ko
# 전체 메시지 포함
git log --format="%h %s" -10 | yaku --to ko

diff의 사람이 읽을 수 있는 부분을 diff 마커를 보존하면서 번역합니다:

Terminal window
git diff HEAD~1 | yaku --to ko

yaku는 변경된 내용을 번역합니다. diff 마커(+, -, @@)와 파일 경로는 LLM의 내장 규칙에 의해 보존됩니다.

모국어로 커밋 메시지를 작성한 후 영어로 번역하거나 다듬습니다:

Terminal window
# 모국어로 작성하고 영어로 번역
echo "로그인 페이지의 유효성 검사 오류를 수정했습니다" | yaku --to en
# Fixed the validation error on the login page
# 또는 대략적인 영어 초안을 다듬기 모드로
echo "fix the bug where user cant login when password has special chars" | \
yaku --mode polish --to en
# Fix the bug where users cannot log in when their password contains special characters

GitHub CLI를 사용하여 PR 설명을 가져와 번역합니다:

Terminal window
# PR 본문 번역
gh pr view 42 --json body -q .body | yaku --to ko
# PR 댓글 번역
gh api repos/owner/repo/pulls/42/comments \
--jq '.[].body' | yaku --to ko
Terminal window
# 최신 릴리스 노트 번역
gh release view --json body -q .body | yaku --to ko
  • git 출력에 --context를 사용하세요. --context "git commit messages"를 추가하면 LLM이 포맷을 이해하도록 돕습니다.
  • 큰 diff에는 head를 통해 파이프하세요. 거대한 diff 전송을 피하세요: git diff | head -200 | yaku --to ko.
  • 커밋 전 검토하세요. 번역된 커밋 메시지를 git 히스토리에 사용하기 전에 항상 검토하세요.