Last Sync: 2026-01-01 23:18 (Mobile)
This commit is contained in:
123
git 생활코딩 강의.md
Normal file
123
git 생활코딩 강의.md
Normal file
@@ -0,0 +1,123 @@
|
||||
#강의 #생활코딩 #git #강의 #유튜브 #egoing
|
||||
# 로그보기
|
||||
```
|
||||
git log --branches --graph --decorate --oneline
|
||||
```
|
||||
|
||||
# banch 병합
|
||||
```
|
||||
git checkout master
|
||||
```
|
||||
```
|
||||
git merge exp
|
||||
```
|
||||
```
|
||||
git checkout exp
|
||||
git merge master
|
||||
git checkout master
|
||||
git barnch -d exp
|
||||
```
|
||||
> 예를 들어 master가 있고, exp가 있는데 master를 기준으로 exp를 master에 넣으려면 git checkout master를 하고 위에 명령처럼 merge를 해 준다
|
||||
|
||||
# branch 지우기
|
||||
```
|
||||
git branch -d [브렌치명]
|
||||
```
|
||||
|
||||
# branch 만들기
|
||||
```
|
||||
git branch -b [브렌치명]
|
||||
```
|
||||
> 브렌치를 만들고 선택까지 해준다.
|
||||
|
||||
# stash, 잠시 숨긴다.
|
||||
```
|
||||
git stash save
|
||||
```
|
||||
> 잠시 작업중 다른작업을 해야할때 임시로숨겨 놓았다가 다시 할때 쓴다.
|
||||
> commit, pull, push등 할때 사용
|
||||
|
||||
```
|
||||
git stash apply
|
||||
```
|
||||
>다시 원상태로 전환
|
||||
|
||||
```
|
||||
git stash list
|
||||
```
|
||||
```
|
||||
git reset --hard HEAD
|
||||
```
|
||||
>수정전 상태로 되돌린다.
|
||||
|
||||
# git 상태 확인
|
||||
```
|
||||
git status
|
||||
```
|
||||
# stash 리스트 삭제
|
||||
```
|
||||
git stash drop
|
||||
```
|
||||
```
|
||||
git stash apply; git stash drop;
|
||||
```
|
||||
>여러가지 명령을 한번에 사용할때 쓴다.
|
||||
|
||||
```
|
||||
git stash pop
|
||||
```
|
||||
>git stash apply; git stash drop; 를 한번에 실행하는 명령
|
||||
|
||||
# branch, HEAD
|
||||
# merge 문제
|
||||
```
|
||||
git branch -D exp
|
||||
```
|
||||
> 강제로 지운다
|
||||
|
||||
# complict 문서의 같은부분 충돌발생
|
||||
|
||||
# reset, branch 과거로 돌아가기
|
||||
```
|
||||
git reset --hard [해시값]
|
||||
```
|
||||
```
|
||||
git reflog
|
||||
```
|
||||
>방금전 실행한 명령어 로그
|
||||
|
||||
```
|
||||
git reset ORIG_HEAD
|
||||
```
|
||||
> 되돌리기
|
||||
|
||||
```
|
||||
git checkout [해시값]
|
||||
```
|
||||
|
||||
| 구분 | 1 | 2 | 3 |
|
||||
| --- | ---------------------------------------------------------- | -------------------------------- | ------------------------------- |
|
||||
| 용어 | working directory, <br> working tree <br> working copy<br> | index<br> staging area<br> cache | repository<br> history<br> tree |
|
||||
| 명령어 | | | git reset --soft |
|
||||
| | | git reset --mixed | git reset --mixed |
|
||||
| | git reset --hard | git reset --hard | git reset --hard |
|
||||
| | | | |
|
||||
```
|
||||
git log -p
|
||||
```
|
||||
>로그자세히 보기
|
||||
|
||||
```
|
||||
git diff
|
||||
```
|
||||
>문서의 다른점 보기(index와 working copy 차이점)
|
||||
|
||||
# merge, conflict
|
||||
```
|
||||
git config --global merge.tool kdiff3
|
||||
```
|
||||
> 병합을 전문적으로 하는 툴
|
||||
|
||||
```
|
||||
git mergetool
|
||||
```
|
||||
Reference in New Issue
Block a user