문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
git [2020/08/17 19:40] kwon37xi |
git [2023/10/14 13:47] (현재) kwon37xi |
||
---|---|---|---|
줄 2: | 줄 2: | ||
* http:// | * http:// | ||
* [[git: | * [[git: | ||
+ | * [[git: | ||
+ | * [[https:// | ||
===== Ubuntu 최신 버전 install ===== | ===== Ubuntu 최신 버전 install ===== | ||
줄 54: | 줄 56: | ||
</ | </ | ||
+ | ===== diff & difftool ===== | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
- | ===== Git Diff -> meld ===== | + | <code sh> |
- | * http:// | + | git difftool |
- | * '' | + | git mergetool |
- | #!/bin/sh | + | |
- | meld " | + | |
</ | </ | ||
- | | + | ===== Git Diff/Merge -> kdiff3 ===== |
- | git config --global | + | |
+ | * 파일 삭제 diff시에 잘 작동 안함. | ||
+ | * https:// | ||
+ | < | ||
+ | [diff] | ||
+ | tool = kdiff3 | ||
+ | [difftool " | ||
+ | path = /usr/ | ||
+ | [difftool] | ||
+ | prompt = false | ||
+ | keepBackup = false | ||
+ | trustExitCode = false | ||
+ | [merge] | ||
+ | tool = kdiff3 | ||
+ | [mergetool] | ||
+ | prompt = false | ||
+ | keepBackup = false | ||
+ | keepTemporaries = false | ||
+ | [mergetool " | ||
+ | | ||
</ | </ | ||
- | ===== Git Mergetool -> meld ===== | + | ===== Git Difftool/Mergetool -> meld ===== |
- | * 전역 | + | * http:// |
- | git config | + | * [[https:// |
+ | * [[http:// | ||
+ | |||
+ | < | ||
+ | # ------------------ M E R G E ------------------------- | ||
+ | [merge] | ||
+ | | ||
+ | |||
+ | [mergetool " | ||
+ | cmd = meld --auto-merge \" | ||
+ | trustExitCode = false | ||
+ | |||
+ | [mergetool] | ||
+ | # don't ask if we want to skip merge | ||
+ | prompt = false | ||
+ | |||
+ | # don't create backup *.orig files | ||
+ | keepBackup = false | ||
+ | |||
+ | # ------------------ D I F F ------------------------- | ||
+ | [diff] | ||
+ | guitool = meld | ||
+ | |||
+ | [difftool " | ||
+ | cmd = meld \" | ||
</ | </ | ||
===== Git Diff -> vimdiff ===== | ===== Git Diff -> vimdiff ===== | ||
+ | * [[vim: | ||
* [[http:// | * [[http:// | ||
* '' | * '' | ||
줄 84: | 줄 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 ===== | ||
줄 109: | 줄 161: | ||
</ | </ | ||
- | ===== Git hook ===== | ||
- | * 기본적으로는 '' | ||
- | * 2.9 부터는 '' | ||
- | * 전역 Hook 파일 설정 (git 2.9+)< | ||
- | git config --global core.hooksPath / | ||
- | </ | ||
- | * [[https:// | ||
===== Commit Template ===== | ===== Commit Template ===== | ||
줄 208: | 줄 253: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
- | * [[http:// | + | * [[git:tig|tig]] 콘솔 기반 리포지토리 브라우저 |
* [[https:// | * [[https:// | ||
* [[http:// | * [[http:// | ||
줄 215: | 줄 260: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | * [[https:// | ||
===== 빈 디렉토리 (empty directory) 유지 ===== | ===== 빈 디렉토리 (empty directory) 유지 ===== | ||
줄 231: | 줄 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 < | ||
+ | </ | ||
===== 문제 해결 ===== | ===== 문제 해결 ===== | ||
줄 261: | 줄 332: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |