문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
wiki:3party:scm:git [2021/08/30 18:14] dhan |
wiki:3party:scm:git [2023/04/26 11:42] (현재) dhan |
||
---|---|---|---|
줄 12: | 줄 12: | ||
[[wiki: | [[wiki: | ||
+ | ===== VCS (Version Control System) ===== | ||
+ | Centralized Version Control: CVS, Subversion, Perforce \\ | ||
+ | Distributed Version Control: git, mercurial, darcs \\ | ||
+ | Server : github, bitbucket \\ | ||
+ | | ||
===== Git 온라인 강의 ===== | ===== Git 온라인 강의 ===== | ||
- | * 깃, 깃허브 제대로 배우기 (기본 마스트편, | + | |
- | * 드림코딩 by 엘리 ( https:// | + | * 널리 이용되어지며, |
+ | | ||
+ | * 드림코딩 by 엘리 ( https:// | ||
<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 > | $> echo *.log > | ||
+ | 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 " | ||
+ | cmd = code --wait --diff $LOCAL $REMOTE // 추가 | ||
+ | $> git difftool // vscode에서 내용 확인 가능 | ||
+ | | ||
+ | 9. commit | ||
+ | $> git commit -m " | ||
+ | $> git commit -am " | ||
+ | |||
+ | 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: | ||
</ | </ | ||
+ | ===== 자격 증명 ===== | ||
+ | * [[https:// | ||
===== Tip ===== | ===== Tip ===== | ||
+ | 원격 저장소 URL 변경하기 | ||
+ | gitbash에서 다음과 같이 진행하면 됨 | ||
+ | <code bash> | ||
+ | // 먼저 해당 git 저장소로 이동 | ||
+ | // 현재 설정 보기 | ||
+ | $> git remote -v | ||
+ | # View existing remotes | ||
+ | origin | ||
+ | origin | ||
+ | // 저장소 변경 | ||
+ | $> git remote set-url origin https:// | ||
+ | // 변경된 저장소 확인 | ||
+ | $> git remote -v | ||
+ | # View existing remotes | ||
+ | origin | ||
+ | origin | ||
+ | $> git remote -v | ||
+ | </ | ||
+ | \\ | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | \\ | ||
===== 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:// | [[http:// | ||
+ | |||
\\ | \\ | ||
+ | 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 ===== | + | </ |
- | {{tag> | + | \\ |
+ | |||
+ | |||
+ | ===== Ref ===== | ||
+ | * [[https:// | ||
+ | * {{wiki: | ||
+ | |||
+ | {{tag> |