사용자 도구

사이트 도구


wiki:3party:scm:git

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
wiki:3party:scm:git [2021/08/30 18:14]
dhan
wiki:3party:scm:git [2023/04/26 11:42] (현재)
dhan
줄 12: 줄 12:
 [[wiki:3party:scm:git:gitbash|GitBash]] \\ [[wiki:3party:scm:git:gitbash|GitBash]] \\
  
 +===== VCS (Version Control System) =====
 +  Centralized Version Control: CVS, Subversion, Perforce \\
 +  Distributed Version Control: git, mercurial, darcs \\
 +  Server : github, bitbucket \\
 +  
 ===== Git 온라인 강의 ===== ===== Git 온라인 강의 =====
-  * 깃, 깃허브 제대로 배우기 (기본 마스트편, 실무에서  꿀리지 말자) +  * Linux Torvalds 2005년 개발  
-    * 드림코딩 by 엘리 ( https://www.youtube.com/watch?v=Z9dvM7qgN9s )+  * 널리 이용되어지며, 무료이고, 오픈 소스이며, 가볍고 빠르다, 오프라인에서도 작업이 가능하며, 실수를 복구할 수 있다. 쉽고 빠른 브랜치와 머징이 가능 
 +  * 깃, 깃허브 제대로 배우기 정리 (기본 마스트편, 실무에서  꿀리지 말자) 
 +    * 드림코딩 by 엘리 ( https://www.youtube.com/watch?v=Z9dvM7qgN9s , https://www.youtube.com/watch?v=lPrxhA4PLoA )
 <code text> <code text>
 1. git  1. git 
줄 68: 줄 75:
       unmodified       unmodified
       modified       modified
-     
-       
              
   <- checkout   <- checkout
줄 85: 줄 90:
      
   remote   remote
-   
-   
      
 7. ignore 7. ignore
줄 92: 줄 95:
   $> echo *.log >.gitignoroe   $> echo *.log >.gitignoroe
  
 +8. diff
 +  $> git diff
 +  diff --git a/c.txt b/c.txt
 +  index a042389..f5be8ac 100644
 +  --- a/c.txt
 +  --- b/c.txt
 +@@ -1 +1,2 @@                       // - 이전 파일 의미, +1 최근 파일
 +                                    // stated, cached 비슷한 의미로 
 + hello world!
 ++add
 +(END)
  
 +  $> git config --global -e
 +[diff]
 +  tool = vscode
 +[difftool "vscode"]
 +  cmd = code --wait --diff $LOCAL $REMOTE // 추가
 +  $> git difftool // vscode에서 내용 확인 가능
 +  
 +9. commit
 +  $> git commit -m "...." // -m -> message
 +  $> git commit -am "...." // -a -> all, add
 +
 +  commit message
 +    commit 0, commit1, commit2, ... (X)
 +    Initialise project, Add LoginService module, Add UserRepository module, Add Welcome page, Add About page, Add light theme, ...
 +    
 +    과하게 커밋하지 말고, 메시지에 맞게 조절합시다.
 +    수정, 여러가지 하지 말고, 수정 첫번째, 수정 두번째.... 향후 코드별 리뷰나 수정이 쉬움
 +    
 +10. log
 +  $> git log
 +  
 +  
 +11. source tree
 +  Hunk 블럭 단위
 +  Line 라인 단위
      
 x터미널 제안 x터미널 제안
 macOS: iTerm21 macOS: iTerm21
 Windows: cmder Windows: cmder
- 
  
 PowerShell  PowerShell 
줄 105: 줄 143:
 </code> </code>
  
 +===== 자격 증명 =====
 +  * [[https://yunseul-light.blogspot.com/2017/08/github-windows-git.html|[Github] Windows 환경에서 Git 자격 증명 변경 (자격 증명 변경)]]
  
 ===== Tip ===== ===== Tip =====
 +원격 저장소 URL 변경하기 
 +gitbash에서 다음과 같이 진행하면 됨 
 +<code bash> 
 +// 먼저 해당 git 저장소로 이동 
 +// 현재 설정 보기 
 +$> git remote -v 
 +# View existing remotes 
 +origin  https://github.com/user/sample.git (fetch) 
 +origin  https://github.com/user/sample.git (push) 
 +// 저장소 변경 
 +$> git remote set-url origin https://github.com/user/new.git 
 +// 변경된 저장소 확인 
 +$> git remote -v 
 +# View existing remotes 
 +origin  https://github.com/user/new.git (fetch) 
 +origin  https://github.com/user/new.git (push) 
 +$> git remote -v 
 +</code> 
 +\\ 
 +[[https://23life.tistory.com/124|원격지 Git Repository 초기화하기]] \\ 
 +[[https://codingdog.tistory.com/entry/git-remote-get-url-%EC%9B%90%EA%B2%A9-url%EC%9D%84-%EC%96%BB%EC%96%B4%EC%98%A8%EB%8B%A4|git remote get-url : 원격 url을 얻어온다.]] \\ 
 +\\
 ===== Troubleshooting ===== ===== Troubleshooting =====
 Checkout conflict with files: 대상 파일 \\ Checkout conflict with files: 대상 파일 \\
줄 113: 줄 174:
 Eclipse 에서 git pull 실행 시, The current branch is not configured for pull 에러 발생 \\  Eclipse 에서 git pull 실행 시, The current branch is not configured for pull 에러 발생 \\ 
 [[http://javakorean.com/eclipse-%EC%97%90%EC%84%9C-git-pull-%EC%8B%A4%ED%96%89-%EC%8B%9C-the-current-branch-is-not-configured-for-pull-%EC%97%90%EB%9F%AC-%EB%B0%9C%EC%83%9D/|Eclipse 에서 git pull 실행 시, The current branch is not configured for pull 에러 발생]] \\ [[http://javakorean.com/eclipse-%EC%97%90%EC%84%9C-git-pull-%EC%8B%A4%ED%96%89-%EC%8B%9C-the-current-branch-is-not-configured-for-pull-%EC%97%90%EB%9F%AC-%EB%B0%9C%EC%83%9D/|Eclipse 에서 git pull 실행 시, The current branch is not configured for pull 에러 발생]] \\
 +
 \\ \\
 +remote: HTTP Basic: Access denied 오류 처리 방법
 +> 잘못된 계정이 저장된 경우
 +git bash에서 차례대로 아래의 명령어를 실행한 수 pull 실행
 +<code bash>
 +$> git config --local --unset credential.helper
 +$> git config --global --unset credential.helper
 +$> git config --system --unset credential.helper
  
 +// 계정 정보를 계속 물어볼 경우
  
-===== Ref =====+</code>
  
  
-{{tag>주레피 git}}+\\ 
 + 
 + 
 +===== Ref ===== 
 +  * [[https://minsone.github.io/git/github-managing-remotes-changing-a-remotes-url|원격 저장소 URL 변경하기]] 
 +  * {{wiki:3party:scm:git:211013wed-git-workflow-on-sts.pdf | Git-workflow pdf}} 
 + 
 +{{tag>주레피 git heon}}
/volume1/web/dokuwiki/data/attic/wiki/3party/scm/git.1630314859.txt.gz · 마지막으로 수정됨: 2022/03/10 19:52 (바깥 편집)