문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
git [2020/08/16 23:30] kwon37xi [Password with kde] |
git [2023/10/14 13:47] (현재) kwon37xi |
||
|---|---|---|---|
| 줄 2: | 줄 2: | ||
| * http:// | * http:// | ||
| * [[git: | * [[git: | ||
| + | * [[git: | ||
| + | * [[https:// | ||
| ===== Ubuntu 최신 버전 install ===== | ===== Ubuntu 최신 버전 install ===== | ||
| 줄 54: | 줄 56: | ||
| </ | </ | ||
| + | ===== diff & difftool ===== | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| - | ===== Password Cache ===== | ||
| - | * HTTP(S) 프로토콜의 경우 명령행에서는 비밀번호 저장해두기가 곤란하다. 그래서 캐시를 사용한다. | ||
| - | * [[http:// | ||
| - | * Linux에서는 다음 처리로 간편하게 캐시가 끝난다.< | ||
| - | # 기본 캐시 시간 15분 | ||
| - | git config --global credential.helper cache | ||
| - | |||
| - | # 캐시 시간 지정 | ||
| - | git config --global credential.helper 'cache --timeout=7200' | ||
| - | </ | ||
| - | |||
| - | ===== libsecret 기반 gnome-keyring credential ===== | ||
| - | * [[https:// | ||
| - | * [[https:// | ||
| - | * '' | ||
| - | * [[https:// | ||
| <code sh> | <code sh> | ||
| - | sudo apt-get install libsecret-1-0 libsecret-1-dev | + | git difftool |
| - | cd /usr/share/doc/git/contrib/credential/libsecret | + | git mergetool |
| - | sudo make | + | </ |
| - | git config --global credential.helper | + | ===== Git Diff/ |
| + | * [[https://docs.kde.org/trunk5/en/extragear-utils/kdiff3/git.html|Using KDiff3 as a Git Diff and Merging Tool]] | ||
| + | * 파일 삭제 diff시에 잘 작동 안함. | ||
| + | * https:// | ||
| + | < | ||
| + | [diff] | ||
| + | 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 = / | ||
| </ | </ | ||
| - | ===== SSH 인증 저장소 | + | ===== Git Difftool/ |
| - | * [[https://www.softwaredeveloper.blog/store-git-ssh-credentials-in-linux|Store Git SSH key pair in Linux with Libsecret | + | * http:// |
| + | * [[https://stackoverflow.com/ | ||
| + | * [[http://blog.marcinchwedczuk.pl/use-meld-as-git-merge-diff-tool|How to use Meld as git merge and diff tool]] : '' | ||
| - | ===== Password with Gnome-Keyring : Deprecated from 2014 ===== | + | < |
| - | * deprecated. | + | # ------------------ M E R G E ------------------------- |
| - | * 사용하지 말 것. '' | + | [merge] |
| - | * [[http:// | + | tool = meld |
| - | ===== Password with kde ===== | + | [mergetool " |
| - | * [[linux: | + | |
| - | ===== Windows ===== | + | |
| - | * [[https:// | + | |
| - | * Unicode 깨짐 문제가 발생함 [[https:// | + | |
| - | # cmd | + | |
| - | set LC_ALL=C.UTF-8 | + | |
| - | # powershell | + | [mergetool] |
| - | $env:LC_ALL=' | + | |
| + | | ||
| - | # 시스템 환경변수에 넣어둘 것 | + | |
| - | </ | + | |
| - | ===== Git Diff -> meld ===== | + | # ------------------ D I F F ------------------------- |
| - | * http:// | + | [diff] |
| - | * '' | + | guitool = meld |
| - | #!/bin/sh | + | |
| - | meld " | + | |
| - | </ | + | |
| - | * add to '' | + | |
| - | git config | + | |
| - | </ | + | |
| - | ===== Git Mergetool -> meld ===== | + | [difftool " |
| - | * 전역 설정 <code sh> | + | cmd = meld \" |
| - | git config | + | |
| </ | </ | ||
| ===== Git Diff -> vimdiff ===== | ===== Git Diff -> vimdiff ===== | ||
| + | * [[vim: | ||
| * [[http:// | * [[http:// | ||
| * '' | * '' | ||
| 줄 129: | 줄 132: | ||
| * 설정의 external 무시하고 vim을 pager로< | * 설정의 external 무시하고 vim을 pager로< | ||
| git diff --no-ext-diff -w | vim -R - | git diff --no-ext-diff -w | vim -R - | ||
| + | </ | ||
| + | * 그냥 명령을 직접 주기< | ||
| + | git diff -y -t vimdiff | ||
| + | # -y 는 no prompt | ||
| </ | </ | ||
| ===== .gitignore ===== | ===== .gitignore ===== | ||
| 줄 154: | 줄 161: | ||
| </ | </ | ||
| - | ===== Git hook ===== | ||
| - | * 기본적으로는 '' | ||
| - | * 2.9 부터는 '' | ||
| - | * 전역 Hook 파일 설정 (git 2.9+)< | ||
| - | git config --global core.hooksPath / | ||
| - | </ | ||
| - | * [[https:// | ||
| ===== Commit Template ===== | ===== Commit Template ===== | ||
| 줄 253: | 줄 253: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| - | * [[http:// | + | * [[git:tig|tig]] 콘솔 기반 리포지토리 브라우저 |
| * [[https:// | * [[https:// | ||
| * [[http:// | * [[http:// | ||
| 줄 260: | 줄 260: | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| + | * [[https:// | ||
| ===== 빈 디렉토리 (empty directory) 유지 ===== | ===== 빈 디렉토리 (empty directory) 유지 ===== | ||
| 줄 276: | 줄 277: | ||
| * commit 한다. | * commit 한다. | ||
| + | ===== shallow update not allowed ===== | ||
| + | * '' | ||
| + | * [[https:// | ||
| + | |||
| + | <code sh> | ||
| + | git fetch --unshallow origin | ||
| + | |||
| + | # 이후에 | ||
| + | git push | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== git blame ignore ===== | ||
| + | * [[https:// | ||
| + | * bulk 갱신, 포맷팅 변경 같은 경우 blame 에 자꾸 나오면 오히려 불편함. 특정 commit 을 blame에서 제외하기 | ||
| + | * [[https:// | ||
| + | |||
| + | ===== submodules ===== | ||
| + | * git 에서 다른 리포지토리를 디렉토리로 링크할 수 있음. | ||
| + | * https:// | ||
| + | * submodule 이 있는 리포지토리를 올바로 clone 하려면 '' | ||
| + | |||
| + | <code sh> | ||
| + | git clone --recursive < | ||
| + | </ | ||
| ===== 문제 해결 ===== | ===== 문제 해결 ===== | ||
| 줄 306: | 줄 332: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||