-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.txt
More file actions
85 lines (59 loc) · 2.24 KB
/
Copy pathtest.txt
File metadata and controls
85 lines (59 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
est
test
aasdf
git branch <new_branch_name> --신규 branch 생성
git branch --branch 목록 보기
git checkout <branch_name> --작업할 branch로 이동
git merge
1. 기준이 되는 branch 로 이동
ex) 기준 branch가 master경우 git branch master 로 이동
2. git merge 합쳐질 branch명
ex) 합쳐질 branch명이 my_branch경우 git merge my_branch
원격 repository
원격 리포지토리 목록
git remote
기존 로컬 디렉토리에 원격 저장소 추가
git remote add origin <repo_url>
내 저장소의 master 브랜치를 origin의 master 브랜치로 push 해라
git push -u origin master
-u : 디폴트 값으로 push
origin을 내 repository의 master 브랜치로 갖고와라(merge)
git pull (origin master)
동기화 시키지는 말고(merge하지는 말고)
origin을 내 repository의 master 브랜치로 일단 갖고와라
git fetch (origin master)
1. git fetch <branch, ex:origin>
2. git checkout origin/master
3. 수정된 파일들 확인
<url>에 있는 원격 저장소 내용을 현재 디렉토리에 복사해 오기
* origin 자동 생성
git clone <url>
원격저장소 삭제
git remote rm <단축이름>
나혼자쓰는 github
맘대로
여럿이 같이 쓰는 github
git branch -M main //현재 branch 명을 main으로 변경?
1. 내 로컬 저장소는 변했는데 원격 저장소는 변함 없는 경우
- push origin master
2. 내 로컬 저장소는 변함 없는데 원격 저장소는 변한 경우
- git pull origin master 로 동기화 후 push
3. 내 로컬 저장소도 변했는데 원격 저장소도 변한 경우
- rebase
1. 새로운 branch 생성 후 작업
2. 원격 저장소에서 git pull origin main 으로 소스받기
3. rebase할 branch 로 이동 > git checkout <branch_nm>
4. git rebase <main_branch>
수정된 branch를 main 최종 커밋 소스에 merge
- pull request ( -> merge)
1. 해당 프로젝트 fork 해오기
2. fork 해온 프로젝트 clone
3. 로컬에서 새 branch 생성
4. 새 branch에서 소스 작업
5. 커밋
git push origin <new_branch>
6. 승인, merge
7. pull request 날린 branch 삭제
git checkout -b newBranch << newBranch로 branch 생성되고 checkout해서 이동
- KEYWORD REVIEW
심화 컨텐츠를 원한다면?