====== Git for Windows ====== ===== Windows msys Git ===== * https://git-scm.com/downloads * [[http://guides.beanstalkapp.com/version-control/git-on-windows.html|Working with Git on Windows  •  Beanstalk Guides]] * [[https://msysgit.github.io/|MsysGit]] [[:mingw|MinGW]] 와 함께 사용하는 git 클라이언트 * Msys 환경에서 한글이 깨질 때 # mintty 콘솔이 CP949일 때는 다음 처리를 하고, UTF-8일 때는 --unset 해버린다. git config --global core.quotepath false # 파일명이 숫자로 보이는 문제 git config --global i18n.logoutputencoding cp949 git config --global i18n.commitencoding cp949 * [[http://stackoverflow.com/questions/5854967/git-msysgit-accents-utf-8-the-definitive-answers|utf 8 - git, msysgit, accents, utf-8, the definitive answers]] * [[https://github.com/msysgit/msysgit/wiki/Git-for-Windows-Unicode-Support|Git for Windows Unicode Support]] * * [[http://stackoverflow.com/questions/20238883/git-diff-and-meld-on-windows|msysgit - Git Diff and Meld on Windows]] ''~/.gitconfig'' 직접 설정 [merge] tool = meld [mergetool "meld"] cmd = "C:/Program\\ Files\\ \\(x86\\)/Meld/Meld.exe" "$BASE" "$LOCAL" "$REMOTE" "$MERGED" [diff] tool = meld [difftool "meld"] cmd = "C:/Program\\ Files\\ \\(x86\\)/Meld/Meld.exe" "$LOCAL" "$REMOTE" * ''git difftool filename'' 형태로 diff를 실행한다. * [[windows:ssh:putty|Putty]]에서 * ''plink''로 SSH 등록 GIT_SSH=c:\Program Files\Putty\plink.exe * ''puttygen'' 으로 OpenSSH로 생성된 private key를 ''.ppk'' 파일로 변환하고, * ''pageant''로 Private Key를 등록해 둔다. * 새로운 호스트에서 clone을 하려면 먼저 ''putty''로 서버측 인증서를 등록해둬야 한다. plink.exe git@github.com * [[:intellij_idea|IntelliJ IDEA]]에서 사용시 ''Version Control -> Git -> SSH Executable''을 ''Native''로 변경한다. * [[https://vladmihalcea.com/tutorials/git/windows-git-ssh-authentication-to-github/|Windows git SSH authentication to GitHub - Vlad Mihalcea]] ===== Unicode/한글 ===== ''git log''에서 한글을 올바로 보려면 set LC_ALL="C.UTF-8" ===== WSL Linux Git ===== * Git 은 그대로 linux용을 사용할 수 있다. * 그리고 이 WSL Linux의 Git을 [[https://github.com/andy-5/wslgit|WSL Git]] 을 이용해 Windows 에서도 호출할 수 있다. ==== ssh-agent for git ==== * SSH를 [[windows:ssh:putty|Putty]] ''plink.exe''를 사하거나 [[windows:wsl:weasel_pageant|Weasel Pageant]]를 사용할 수 있다. ''weasel-pageant'' 권장. export GIT_SSH=/mnt/c/Program\ Files/PuTTY/plink.exe ==== Diff tool for windows ==== * [[https://www.sep.com/sep-blog/2017/06/07/20170607wsl-git-and-beyond-compare/|WSL, git, and Beyond Compare - SEP Blog]] ==== 참조 ==== * [[http://occamsrazr.net/tt/358|류광의 번역 이야기 :: Git Bash 팁 두 가지]] * [[https://jusths.tistory.com/180|윈도우 PowerShell에서 git을 좀더 편하게 사용하자]]