문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
git [2019/06/26 19:09] kwon37xi [파일 chmod 변경 - 특히 실행(x) 권한] |
git [2020/10/10 17:24] kwon37xi [Git Diff/Merge -> kdiff3] |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== git ====== | ====== git ====== | ||
* http:// | * http:// | ||
+ | * [[git: | ||
+ | * [[git: | ||
+ | |||
+ | ===== Ubuntu 최신 버전 install ===== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | <code sh> | ||
+ | sudo add-apt-repository ppa: | ||
+ | sudo apt update | ||
+ | sudo apt install git | ||
+ | </ | ||
===== Client 설정 ===== | ===== Client 설정 ===== | ||
줄 14: | 줄 25: | ||
git config --global core.filemode false | git config --global core.filemode false | ||
- | # Mac OS X 유니코드 문제 | + | # Mac OS X 유니코드 문제? 아직도 발생하나? |
- | git config --global core.precomposeunicode true | + | # git config --global core.precomposeunicode true |
</ | </ | ||
줄 36: | 줄 47: | ||
name = KwonNamSon | name = KwonNamSon | ||
</ | </ | ||
+ | * **includeIf 는 맨 마지막에 두는 것이 좋다.** 이 이후에 나오는 설정은 '' | ||
===== Ubuntu Git 최신 버전 ===== | ===== Ubuntu Git 최신 버전 ===== | ||
* https:// | * https:// | ||
줄 44: | 줄 55: | ||
</ | </ | ||
+ | ===== diff & difftool ===== | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
- | ===== Password Cache ===== | + | <code sh> |
- | * HTTP(S) 프로토콜의 경우 명령행에서는 비밀번호 저장해두기가 곤란하다. 그래서 캐시를 사용한다. | + | git difftool |
- | * [[http:// | + | git mergetool |
- | * Linux에서는 다음 처리로 간편하게 캐시가 끝난다.<code sh> | + | |
- | # 기본 캐시 시간 15분 | + | |
- | git config | + | |
- | + | ||
- | # 캐시 시간 지정 | + | |
- | git config --global credential.helper 'cache --timeout=7200' | + | |
</ | </ | ||
- | + | ===== Git Diff/ | |
- | ===== Password with Gnome-Keyring | + | * [[https://docs.kde.org/trunk5/en/ |
- | * [[http://blog.iqandreas.com/git/storing-https-authentication-in-ubuntu-and-arch-linux/|GIT: Storing HTTPS Authentication in Ubuntu (and Arch Linux) - The Programming Blog of Andreas Renberg (IQAndreas)]]<code sh> | + | * 파일 삭제 diff시에 잘 작동 안함. |
- | # on Ubuntu | + | * https://github.com/KDE/kdiff3/blob/master/ChangeLog : Version 1.8.3 부터 해결됨. |
- | sudo apt-get install libgnome-keyring-dev | + | < |
- | sudo make --directory=/usr/share/doc/git/contrib/credential/gnome-keyring | + | [diff] |
- | git config --global credential.helper | + | tool = kdiff3 |
+ | [difftool " | ||
+ | path = /usr/bin/kdiff3 | ||
+ | [difftool] | ||
+ | prompt = false | ||
+ | keepBackup = false | ||
+ | trustExitCode = false | ||
+ | [merge] | ||
+ | tool = kdiff3 | ||
+ | [mergetool] | ||
+ | prompt = false | ||
+ | keepBackup = false | ||
+ | keepTemporaries = false | ||
+ | [mergetool " | ||
+ | path = /usr/bin/kdiff3 | ||
</ | </ | ||
- | ===== Windows | + | ===== Git Difftool/ |
- | * [[https://github.com/Microsoft/Git-Credential-Manager-for-Windows|Git credential manager for windows]] | + | * http://wiredforcode.com/blog/2011/ |
- | * Unicode 깨짐 문제가 발생함 | + | * [[https:// |
- | # cmd | + | * [[http:// |
- | set LC_ALL=C.UTF-8 | + | |
- | # powershell | + | < |
- | $env:LC_ALL=' | + | # ------------------ M E R G E ------------------------- |
+ | [merge] | ||
+ | tool = meld | ||
- | # 시스템 환경변수에 넣어둘 것 | + | [mergetool " |
- | </ | + | cmd = meld --auto-merge \" |
+ | trustExitCode = false | ||
- | ===== Git Diff -> meld ===== | + | [mergetool] |
- | * http:// | + | # don't ask if we want to skip merge |
- | * '' | + | prompt |
- | #!/bin/sh | + | |
- | meld " | + | # don't create backup |
- | </ | + | keepBackup = false |
- | * add to '' | + | |
- | git config | + | # ------------------ D I F F ------------------------- |
- | </ | + | [diff] |
+ | guitool = meld | ||
- | ===== Git Mergetool -> meld ===== | + | [difftool " |
- | * 전역 설정 <code sh> | + | cmd = meld \" |
- | git config | + | |
</ | </ | ||
줄 132: | 줄 157: | ||
===== Git hook ===== | ===== Git hook ===== | ||
* 기본적으로는 '' | * 기본적으로는 '' | ||
+ | * 2.9 부터는 '' | ||
* 전역 Hook 파일 설정 (git 2.9+)< | * 전역 Hook 파일 설정 (git 2.9+)< | ||
git config --global core.hooksPath / | git config --global core.hooksPath / | ||
</ | </ | ||
+ | * [[https:// | ||
===== Commit Template ===== | ===== Commit Template ===== | ||
줄 187: | 줄 214: | ||
export PS1=" | export PS1=" | ||
+ | </ | ||
+ | |||
+ | ===== bash auto completion ===== | ||
+ | * 대부분의 리눅스는 git 을 설치하면 이미 bash-completion 설정 파일을 함께 설치한다.< | ||
+ | source / | ||
+ | # or | ||
+ | source / | ||
+ | </ | ||
+ | * [[https:// | ||
+ | * Arch/ | ||
+ | sudo pacman -S git bash-completion | ||
+ | # shell 재실행 | ||
</ | </ | ||
줄 230: | 줄 269: | ||
</ | </ | ||
- | ===== 파일 chmod 변경 - 특히 실행(x) 권한 ===== | + | ===== Windows 등에서 |
* [[https:// | * [[https:// | ||
+ | * 아래는 Linux/*nix 계열에서는 불필요하고 작동하지도 않았다. 그냥 '' | ||
* '' | * '' | ||
* '' | * '' | ||
줄 264: | 줄 304: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |