사용자 도구

사이트 도구


git

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
git [2019/11/06 13:49]
kwon37xi
git [2020/10/10 17:03]
kwon37xi [Ubuntu Git 최신 버전]
줄 2: 줄 2:
   * http://git-scm.com/   * http://git-scm.com/
   * [[git:cheatsheet|Git Cheatsheet]]   * [[git:cheatsheet|Git Cheatsheet]]
 +  * [[git:credential|git credential]]
 +
 +===== Ubuntu 최신 버전 install =====
 +  * [[https://itsfoss.com/install-git-ubuntu/|How to Install the Latest Git Version on Ubuntu]]
 +  * [[https://launchpad.net/~git-core/+archive/ubuntu/ppa|git-core/ppa]]
 +<code sh>
 +sudo add-apt-repository ppa:git-core/ppa
 +sudo apt update
 +sudo apt install git
 +</code>
  
 ===== Client 설정 ===== ===== Client 설정 =====
줄 15: 줄 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 
  
 </code> </code>
줄 37: 줄 47:
   name = KwonNamSon   name = KwonNamSon
 </code> </code>
 +  * **includeIf 는 맨 마지막에 두는 것이 좋다.** 이 이후에 나오는 설정은 ''includeIf''에 있는 설정을 덮어쓴다.
 ===== Ubuntu Git 최신 버전 ===== ===== Ubuntu Git 최신 버전 =====
   * https://launchpad.net/~git-core/+archive/ubuntu/ppa<code sh>   * https://launchpad.net/~git-core/+archive/ubuntu/ppa<code sh>
줄 45: 줄 55:
 </code> </code>
  
- +===== diff & difftool ===== 
-===== Password Cache ===== +  * ''git diff'' 명령에서 실행하는 것이 ''[diff]'' 항목, ''git difftool''에서 실행하는 것이 ''[difftool]'' 항목이다. 
-  * HTTP(S) 프로토콜의 경우 명령에서는 비밀번호 저장해두기가 곤란하다. 그래서 캐시를 사용한다. +  * ''diff''는 기본값 그대로 두고 ''difftool''을 바꾸자. ''diff''는 pager 를 끼고 실행되는데, GUI diff 를 사용할 경우 pager가 중에 끼어든다"pager = " 설정으로 페이저를 없앨 수 있만, log 등을 볼 때 페이저가 없어서 문제가 된다
-  * [[http://dogfeet.github.io/articles/2013/git-password-caching.html|Git Password Caching]] +===== Git Diff/Merge -> kdiff3 ===== 
-  * Linux에서는 다음 처리로 간편하게 캐시가 끝난다.<code sh> +  * [[https://docs.kde.org/trunk5/en/extragear-utils/kdiff3/git.html|Using KDiff3 as a Git Diff and Merging Tool]] 
-기본 캐시 시간 15분 +<code> 
-git config --global credential.helper cache +[diff] 
- +        tool = kdiff3 
-# 캐시 시간 정 +[difftool "kdiff3"
-git config --global credential.helper 'cache --timeout=7200' +        path = /usr/bin/kdiff3 
-</code> +[difftool] 
- +        prompt = false 
-===== Password with Gnome-Keyring  ===== +        keepBackup = false 
-  * [[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+        trustExitCode false 
-# on Ubuntu +[merge
-sudo apt-get install libgnome-keyring-dev +        tool = kdiff3 
-sudo make --directory=/usr/share/doc/git/contrib/credential/gnome-keyring +[mergetool
-git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring +        prompt = false 
-</code> +        keepBackup false 
- +        keepTemporaries = false 
-===== Windows ===== +[mergetool "kdiff3"] 
-  [[https://github.com/Microsoft/Git-Credential-Manager-for-Windows|Git credential manager for windows]+        path /usr/bin/kdiff3
-  * Unicode 깨짐 문제가 발생함 [[https://stackoverflow.com/questions/41139067/git-log-output-encoding-issues-on-windows-10-command-prompt|git log output encoding issues on Windows 10 command prompt - Stack Overflow]]<code sh> +
-# cmd +
-set LC_ALL=C.UTF-8 +
- +
-# powershell +
-$env:LC_ALL='C.UTF-8' +
- +
-# 시스템 환경변수에 넣어둘 것+
 </code> </code>
  
줄 190: 줄 192:
 export PS1="\[\033[01;32m\][\[\033[01;33m\]\u\[\033[01;36m\]@\[\033[01;31m\]\h\[\033[01;37m\]:\[\033[01;34m\]\w\[\033[01;32m\]\$(__git_ps1)]\[\033[01;35m\]\\$\[\033[00m\] " export PS1="\[\033[01;32m\][\[\033[01;33m\]\u\[\033[01;36m\]@\[\033[01;31m\]\h\[\033[01;37m\]:\[\033[01;34m\]\w\[\033[01;32m\]\$(__git_ps1)]\[\033[01;35m\]\\$\[\033[00m\] "
  
 +</code>
 +
 +===== bash auto completion =====
 +  * 대부분의 리눅스는 git 을 설치하면 이미 bash-completion 설정 파일을 함께 설치한다.<code sh>
 +source /etc/bash_completion.d/git
 +# or
 +source /usr/share/bash-completion/completions/git
 +</code>
 +  * [[https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion|Install Bash git completion · bobthecow/git-flow-completion Wiki]]
 +  * Arch/Manjaro <code>
 +sudo pacman -S git bash-completion
 +# shell 재실행
 </code> </code>
  
git.txt · 마지막으로 수정됨: 2023/10/14 13:47 저자 kwon37xi