SlideShare a Scribd company logo
1 of 61
Download to read offline
GIT은 어떻게 동작하는가

13년	 10월	 17일	 목요일
세션 내용 소개

1.
 저장소와
 커밋
2.
 브랜치와
 머지
3.
 Push
 
 PULL
 
4.
 JGit을
 이용한
 Pull
 Request의
 구현

13년	 10월	 17일	 목요일
주의

Git의
 사용법에
 대해서는
이야기하지
 않습니다.

13년	 10월	 17일	 목요일
$ git init
$ echo Hello  a.txt
$ echo World  b.txt

# 저장소를 만든다.

Git Repository (non-bare)
Working Directory (.)
a.txt

“Hello”

b.txt

Object Database
(.git/objects/)

“World”

Refs (.git/)

저장소와 커밋
$ cat .git/HEAD
refs: refs/heads/master

13년	 10월	 17일	 목요일

HEAD

master

bad default
revision
$ git add a.txt
$ git add b.txt

Git Repository (non-bare)
Working Directory (.)
a.txt
b.txt

“Hello”
“World”

Index (.git/index)
a.txt

e965

b.txt

216e

Object Database
(.git/objects/)
blob e965

Refs (.git/)

bad default
revision

HEAD

“Hello”
blob 216e

master

“World”

.git/objects/
21/6e97ce08229b8776d3feb731c6d23a2f669ac8

13년	 10월	 17일	 목요일
$ git commit -m ‘Add a.txt and b.txt’

Git Repository (non-bare)
Working Directory (.)
a.txt
b.txt

“Hello”
“World”

Index (.git/index)
a.txt
b.txt

13년	 10월	 17일	 목요일

e965
216e

Object Database
(.git/objects/)
blob e965

Refs (.git/)

HEAD

“Hello”
blob 216e
“World”

master

bad default
revision
$ git commit -m ‘Add a.txt and b.txt’
bad default
revision
Git Repository (non-bare)
Working Directory (.)
a.txt

“Hello”

b.txt

Object Database
(.git/objects/)

“World”

e965

b.txt

216e

tree 9d1c

master

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”

13년	 10월	 17일	 목요일

HEAD

commit 73d3

Index (.git/index)
a.txt

Refs (.git/)
$ echo HELLO  a.txt

Git Repository (non-bare)
Working Directory (.)
a.txt

“Hello”

b.txt

Refs (.git/)

HEAD

Object Database
(.git/objects/)

“World”

commit 73d3
tree 9d1c

Index (.git/index)
a.txt

e965

b.txt

216e

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”

13년	 10월	 17일	 목요일

master
$ echo HELLO  a.txt

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

b.txt

Refs (.git/)

HEAD

Object Database
(.git/objects/)

“World”

commit 73d3
tree 9d1c

Index (.git/index)
a.txt

e965

b.txt

216e

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”

13년	 10월	 17일	 목요일

master
$ echo HELLO  a.txt
$ git add a.txt

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

b.txt

Refs (.git/)

HEAD

Object Database
(.git/objects/)

“World”

commit 73d3
tree 9d1c

Index (.git/index)
a.txt

e965

b.txt

216e

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”

13년	 10월	 17일	 목요일

master
$ echo HELLO  a.txt
$ git add a.txt

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

b.txt

Refs (.git/)

HEAD

Object Database
(.git/objects/)

master

“World”

Index (.git/index)
a.txt

e965

b.txt

blob e427

216e

“HELLO”
commit 73d3
tree 9d1c

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”
13년	 10월	 17일	 목요일
$ echo HELLO  a.txt
$ git add a.txt

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

b.txt

Refs (.git/)

HEAD

Object Database
(.git/objects/)

master

“World”

Index (.git/index)

blob e427

a.txt

e427

“HELLO”

b.txt

216e
commit 73d3
tree 9d1c

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”
13년	 10월	 17일	 목요일
$ echo HELLO  a.txt
$ git add a.txt
$ git commit -m ‘Update a.txt’

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

b.txt

a.txt

e427

b.txt

HEAD

Object Database
(.git/objects/)

“World”

Index (.git/index)

Refs (.git/)

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

216e

master

commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”
13년	 10월	 17일	 목요일
$ echo HELLO  a.txt
$ git add a.txt
$ git commit -m ‘Update a.txt’

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

b.txt

a.txt

e427

b.txt

HEAD

Object Database
(.git/objects/)

“World”

Index (.git/index)

Refs (.git/)

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

216e

master

commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”
13년	 10월	 17일	 목요일
$ rm b.txt

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

b.txt

a.txt

e427

b.txt

HEAD

Object Database
(.git/objects/)

“World”

Index (.git/index)

Refs (.git/)

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

216e

master

commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”
13년	 10월	 17일	 목요일
$ rm b.txt
$ git rm --cached b.txt

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 06d2

Index (.git/index)
a.txt

e427

b.txt

blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

216e

master

commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”
13년	 10월	 17일	 목요일
$ rm b.txt
$ git rm --cached b.txt
$ git commit -m ‘Delete b.txt’

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 06d2

Index (.git/index)
a.txt

e427

blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c

tree

9d1c

blob e965

blob e965 a.txt

...저자 등등...

“Hello”

blob 216e b.txt

“Add a.txt and b.txt”

blob 216e
“World”
13년	 10월	 17일	 목요일
$ rm b.txt
$ git rm --cached b.txt
$ git commit -m ‘Delete b.txt’

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 4fa8

Index (.git/index)
a.txt

blob e427 a.txt

e427

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”
commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c
13년	 10월	 17일	 목요일

blob e965

blob e965 a.txt

tree

9d1c

...저자 등등...
$ rm b.txt
$ git rm --cached b.txt
$ git commit -m ‘Delete b.txt’

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 4fa8

Index (.git/index)
a.txt

blob e427 a.txt

e427

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”
commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c
13년	 10월	 17일	 목요일

blob e965

blob e965 a.txt

tree

9d1c

...저자 등등...
$ mv a.txt A.txt

Git Repository (non-bare)
Working Directory (.)
a.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 4fa8

Index (.git/index)
a.txt

blob e427 a.txt

e427

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”
commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c
13년	 10월	 17일	 목요일

blob e965

blob e965 a.txt

tree

9d1c

...저자 등등...
$ mv a.txt A.txt

Git Repository (non-bare)
Working Directory (.)
A.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 4fa8

Index (.git/index)
a.txt

blob e427 a.txt

e427

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”
commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c
13년	 10월	 17일	 목요일

blob e965

blob e965 a.txt

tree

9d1c

...저자 등등...
$ mv a.txt A.txt
$ git rm --cached a.txt

Git Repository (non-bare)
Working Directory (.)
A.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 4fa8

Index (.git/index)
a.txt

blob e427 a.txt

e427

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”
commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c
13년	 10월	 17일	 목요일

blob e965

blob e965 a.txt

tree

9d1c

...저자 등등...
$ mv a.txt A.txt
$ git rm --cached a.txt

Git Repository (non-bare)
Working Directory (.)
A.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 4fa8

Index (.git/index)

blob e427 a.txt

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”
commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c
13년	 10월	 17일	 목요일

blob e965

blob e965 a.txt

tree

9d1c

...저자 등등...
$ mv a.txt A.txt
$ git rm --cached a.txt
$ git add A.txt

Git Repository (non-bare)
Working Directory (.)
A.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 4fa8

Index (.git/index)

blob e427 a.txt

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”
commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c
13년	 10월	 17일	 목요일

blob e965

blob e965 a.txt

tree

9d1c

...저자 등등...
$ mv a.txt A.txt
$ git rm --cached a.txt
$ git add A.txt

Git Repository (non-bare)
Working Directory (.)
A.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 4fa8

Index (.git/index)
A.txt

blob e427 a.txt

e427

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”
commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c
13년	 10월	 17일	 목요일

blob e965

blob e965 a.txt

tree

9d1c

...저자 등등...
$ git commit -m ‘Rename a.txt to A.txt’

Git Repository (non-bare)
Working Directory (.)
A.txt

“HELLO”

Refs (.git/)

HEAD

Object Database
(.git/objects/)
tree 4fa8

Index (.git/index)
A.txt

blob e427 a.txt

e427

tree 06d2
blob e427

blob e427 a.txt

“HELLO”

blob 216e b.txt

master

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”
commit 8511
tree
06d2
parent
73d3
...저자 등등...
“Update a.txt”
commit 73d3

tree 9d1c
13년	 10월	 17일	 목요일

blob e965

blob e965 a.txt

tree

9d1c

...저자 등등...
$ git commit -m ‘Rename a.txt to A.txt’

Git Repository (non-bare)
Working Directory (.)
A.txt

“HELLO”

HEAD

Object Database
(.git/objects/)
tree 8808

Index (.git/index)
A.txt

Refs (.git/)

blob e427 A.txt

e427

master

commit 2825
tree
8808
parent
8511
...저자 등등...
“Rename a.txt to...”

blob e427 a.txt

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”

tree 06d2

commit 8511
tree
06d2
parent
73d3

tree 4fa8
blob e427
“HELLO”

13년	 10월	 17일	 목요일

blob e427 a.txt
$ git commit -m ‘Rename a.txt to A.txt’

Git Repository (non-bare)
Working Directory (.)
A.txt

“HELLO”

HEAD

Object Database
(.git/objects/)
tree 8808

Index (.git/index)
A.txt

Refs (.git/)

blob e427 A.txt

e427

master

commit 2825
tree
8808
parent
8511
...저자 등등...
“Rename a.txt to...”

blob e427 a.txt

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”

tree 06d2

commit 8511
tree
06d2
parent
73d3

tree 4fa8
blob e427
“HELLO”

13년	 10월	 17일	 목요일

blob e427 a.txt
$ mkdir src

Git Repository (non-bare)
Working Directory (.)
A.txt

“HELLO”

HEAD

Object Database
(.git/objects/)
tree 8808

Index (.git/index)
A.txt

Refs (.git/)

blob e427 A.txt

e427

master

commit 2825
tree
8808
parent
8511
...저자 등등...
“Rename a.txt to...”

blob e427 a.txt

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”

tree 06d2

commit 8511
tree
06d2
parent
73d3

tree 4fa8
blob e427
“HELLO”

13년	 10월	 17일	 목요일

blob e427 a.txt
$ mkdir src
$ git mv A.txt src/A.txt

Git Repository (non-bare)
Working Directory (.)
src/
A.txt

HEAD

Object Database
(.git/objects/)

“HELLO”
tree 8808

Index (.git/index)
A.txt

Refs (.git/)

blob e427 A.txt

e427

master

commit 2825
tree
8808
parent
8511
...저자 등등...
“Rename a.txt to...”

blob e427 a.txt

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”

tree 06d2

commit 8511
tree
06d2
parent
73d3

tree 4fa8
blob e427
“HELLO”

13년	 10월	 17일	 목요일

blob e427 a.txt
$ mkdir src
$ git mv A.txt src/A.txt

Git Repository (non-bare)
Working Directory (.)
src/
src/A.txt

HEAD

Object Database
(.git/objects/)

“HELLO”
tree 8808

Index (.git/index)
A.txt

Refs (.git/)

blob e427 A.txt

e427

master

commit 2825
tree
8808
parent
8511
...저자 등등...
“Rename a.txt to...”

blob e427 a.txt

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”

tree 06d2

commit 8511
tree
06d2
parent
73d3

tree 4fa8
blob e427
“HELLO”

13년	 10월	 17일	 목요일

blob e427 a.txt
$ mkdir src
$ git mv A.txt src/A.txt
$ git commit -m ‘Move A.txt into src’

Git Repository (non-bare)
Working Directory (.)
src/
src/A.txt

HEAD

Object Database
(.git/objects/)

“HELLO”
tree 8808

Index (.git/index)
src/A.txt

Refs (.git/)

blob e427 A.txt

e427

master

commit 2825
tree
8808
parent
8511
...저자 등등...
“Rename a.txt to...”

blob e427 a.txt

commit 8bc3
tree
4fa8
parent
8511
...저자 등등...
“Delete b.txt”

tree 06d2

commit 8511
tree
06d2
parent
73d3

tree 4fa8
blob e427
“HELLO”

13년	 10월	 17일	 목요일

blob e427 a.txt
$ mkdir src
$ git mv A.txt src/A.txt
$ git commit -m ‘Move A.txt into src’

Git Repository (non-bare)
Working Directory (.)
src/
src/A.txt

HEAD

Object Database
(.git/objects/)

“HELLO”
tree 2dc1

Index (.git/index)
src/A.txt

Refs (.git/)

tree 8808 src/

e427

tree 8808
blob e427

blob e427 A.txt

“HELLO”

tree 4fa8
13년	 10월	 17일	 목요일

blob e427 a.txt

master

commit 3183
tree
2dc1
parent
2825
...저자 등등...
“Move a.txt into src”
commit 2825
tree
8808
parent
8511
...저자 등등...
“Rename a.txt to...”
commit 8bc3
tree
4fa8
parent
8511
$ mkdir src
$ git mv A.txt src/A.txt
$ git commit -m ‘Move A.txt into src’

Git Repository (non-bare)
Working Directory (.)
src/
src/A.txt

HEAD

Object Database
(.git/objects/)

“HELLO”
tree 2dc1

Index (.git/index)
src/A.txt

Refs (.git/)

tree 8808 src/

e427

tree 8808
blob e427

blob e427 A.txt

“HELLO”

tree 4fa8
13년	 10월	 17일	 목요일

blob e427 a.txt

master

commit 3183
tree
2dc1
parent
2825
...저자 등등...
“Move a.txt into src”
commit 2825
tree
8808
parent
8511
...저자 등등...
“Rename a.txt to...”
commit 8bc3
tree
4fa8
parent
8511
$ mkdir src
$ git mv A.txt src/A.txt
$ git commit -m ‘Move A.txt into src’

Git Repository (non-bare)
Working Directory (.)
src/
src/A.txt

“HELLO”

Index (.git/index)
src/A.txt

e427

Refs (.git/)

HEAD

Object Database
(.git/objects/)

src/
브랜치와 머지
tree 2dc1

tree 8808 src/

tree 8808
blob e427

HELLO
“HELLO”

blob e427 A.txt

A.txt

tree 4fa8
13년	 10월	 17일	 목요일

blob a.txt a.txt
e427

master

commit 3183
tree Move
2dc1
parent A.txt...
2825
...저자 등등...
“Move a.txt into src”
commit 2825
treeRename
8808
parent
8511
a.txt...
...저자 등등...
“Rename a.txt to...”
commit 8bc3
tree
4fa8
Delete
parent
8511
t5

E

t4

D

t3

C

b2

t2

B

b1

t1

A

b3

13년	 10월	 17일	 목요일

master

HEAD
$ git co -b branch-1

t5

E

t4

D

t3

C

b2

t2

B

b1

t1

A

b3

13년	 10월	 17일	 목요일

branch-1
master HEAD
$ git co -b branch-1

t5

E

t4

D

t3

C

b2

t2

B

b1

t1

A

b3

13년	 10월	 17일	 목요일

branch-1 HEAD
master
$ git commit
b2

t2

t5

F
E

t4

D

t3

C

b2

t2

B

b1

t1

A

b3

13년	 10월	 17일	 목요일

branch-1 HEAD
master
$ git commit
b2

t2

t5

F

branch-1 HEAD

E

master

t4

D

t3

C

b2

t2

B

b1

t1

A

b3

13년	 10월	 17일	 목요일
$ git co master
b2

t2

t5

F

branch-1 HEAD

E

master

t4

D

t3

C

b2

t2

B

b1

t1

A

b3

13년	 10월	 17일	 목요일
$ git co master
b2

t2

t5

F

branch-1

E

master

t4

D

t3

C

b2

t2

B

b1

t1

A

b3

13년	 10월	 17일	 목요일

HEAD
$ git merge branch-1
b2

t2

t5

F

branch-1

E

master

t4

D

t3

C

b2

t2

B

b1

t1

A

b3

13년	 10월	 17일	 목요일

HEAD

상황1: 머지할 브랜
치가 현재 브랜치의
모든 커밋을 포함함
$ git merge branch-1
b2

t2

t5

F
E

t4

D

t3

C

b2

t2

B

b1

t1

A

b3

13년	 10월	 17일	 목요일

branch-1
master HEAD
Fast-Forward
$ git merge branch-1

master

branch-1
b6

G

F

t6

t5

E

t4
b3
13년	 10월	 17일	 목요일

D

t3

C

t7

HEAD
b7

상황2: 머지할 브랜
치가 현재 브랜치의
모든 커밋을 포함하
지는 않음

More Related Content

More from NAVER D2

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다NAVER D2
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...NAVER D2
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기NAVER D2
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발NAVER D2
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈NAVER D2
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&ANAVER D2
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기NAVER D2
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep LearningNAVER D2
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applicationsNAVER D2
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingNAVER D2
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지NAVER D2
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기NAVER D2
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화NAVER D2
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)NAVER D2
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기NAVER D2
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual SearchNAVER D2
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화NAVER D2
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지NAVER D2
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터NAVER D2
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?NAVER D2
 

More from NAVER D2 (20)

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?
 

DEVIEW 2013 - Git은 어떻게 동작하는가

  • 8.  
  • 10.   4.
  • 20. $ git init $ echo Hello a.txt $ echo World b.txt # 저장소를 만든다. Git Repository (non-bare) Working Directory (.) a.txt “Hello” b.txt Object Database (.git/objects/) “World” Refs (.git/) 저장소와 커밋 $ cat .git/HEAD refs: refs/heads/master 13년 10월 17일 목요일 HEAD master bad default revision
  • 21. $ git add a.txt $ git add b.txt Git Repository (non-bare) Working Directory (.) a.txt b.txt “Hello” “World” Index (.git/index) a.txt e965 b.txt 216e Object Database (.git/objects/) blob e965 Refs (.git/) bad default revision HEAD “Hello” blob 216e master “World” .git/objects/ 21/6e97ce08229b8776d3feb731c6d23a2f669ac8 13년 10월 17일 목요일
  • 22. $ git commit -m ‘Add a.txt and b.txt’ Git Repository (non-bare) Working Directory (.) a.txt b.txt “Hello” “World” Index (.git/index) a.txt b.txt 13년 10월 17일 목요일 e965 216e Object Database (.git/objects/) blob e965 Refs (.git/) HEAD “Hello” blob 216e “World” master bad default revision
  • 23. $ git commit -m ‘Add a.txt and b.txt’ bad default revision Git Repository (non-bare) Working Directory (.) a.txt “Hello” b.txt Object Database (.git/objects/) “World” e965 b.txt 216e tree 9d1c master tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일 HEAD commit 73d3 Index (.git/index) a.txt Refs (.git/)
  • 24. $ echo HELLO a.txt Git Repository (non-bare) Working Directory (.) a.txt “Hello” b.txt Refs (.git/) HEAD Object Database (.git/objects/) “World” commit 73d3 tree 9d1c Index (.git/index) a.txt e965 b.txt 216e tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일 master
  • 25. $ echo HELLO a.txt Git Repository (non-bare) Working Directory (.) a.txt “HELLO” b.txt Refs (.git/) HEAD Object Database (.git/objects/) “World” commit 73d3 tree 9d1c Index (.git/index) a.txt e965 b.txt 216e tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일 master
  • 26. $ echo HELLO a.txt $ git add a.txt Git Repository (non-bare) Working Directory (.) a.txt “HELLO” b.txt Refs (.git/) HEAD Object Database (.git/objects/) “World” commit 73d3 tree 9d1c Index (.git/index) a.txt e965 b.txt 216e tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일 master
  • 27. $ echo HELLO a.txt $ git add a.txt Git Repository (non-bare) Working Directory (.) a.txt “HELLO” b.txt Refs (.git/) HEAD Object Database (.git/objects/) master “World” Index (.git/index) a.txt e965 b.txt blob e427 216e “HELLO” commit 73d3 tree 9d1c tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일
  • 28. $ echo HELLO a.txt $ git add a.txt Git Repository (non-bare) Working Directory (.) a.txt “HELLO” b.txt Refs (.git/) HEAD Object Database (.git/objects/) master “World” Index (.git/index) blob e427 a.txt e427 “HELLO” b.txt 216e commit 73d3 tree 9d1c tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일
  • 29. $ echo HELLO a.txt $ git add a.txt $ git commit -m ‘Update a.txt’ Git Repository (non-bare) Working Directory (.) a.txt “HELLO” b.txt a.txt e427 b.txt HEAD Object Database (.git/objects/) “World” Index (.git/index) Refs (.git/) tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt 216e master commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일
  • 30. $ echo HELLO a.txt $ git add a.txt $ git commit -m ‘Update a.txt’ Git Repository (non-bare) Working Directory (.) a.txt “HELLO” b.txt a.txt e427 b.txt HEAD Object Database (.git/objects/) “World” Index (.git/index) Refs (.git/) tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt 216e master commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일
  • 31. $ rm b.txt Git Repository (non-bare) Working Directory (.) a.txt “HELLO” b.txt a.txt e427 b.txt HEAD Object Database (.git/objects/) “World” Index (.git/index) Refs (.git/) tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt 216e master commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일
  • 32. $ rm b.txt $ git rm --cached b.txt Git Repository (non-bare) Working Directory (.) a.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 06d2 Index (.git/index) a.txt e427 b.txt blob e427 blob e427 a.txt “HELLO” blob 216e b.txt 216e master commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일
  • 33. $ rm b.txt $ git rm --cached b.txt $ git commit -m ‘Delete b.txt’ Git Repository (non-bare) Working Directory (.) a.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 06d2 Index (.git/index) a.txt e427 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c tree 9d1c blob e965 blob e965 a.txt ...저자 등등... “Hello” blob 216e b.txt “Add a.txt and b.txt” blob 216e “World” 13년 10월 17일 목요일
  • 34. $ rm b.txt $ git rm --cached b.txt $ git commit -m ‘Delete b.txt’ Git Repository (non-bare) Working Directory (.) a.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 4fa8 Index (.git/index) a.txt blob e427 a.txt e427 tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c 13년 10월 17일 목요일 blob e965 blob e965 a.txt tree 9d1c ...저자 등등...
  • 35. $ rm b.txt $ git rm --cached b.txt $ git commit -m ‘Delete b.txt’ Git Repository (non-bare) Working Directory (.) a.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 4fa8 Index (.git/index) a.txt blob e427 a.txt e427 tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c 13년 10월 17일 목요일 blob e965 blob e965 a.txt tree 9d1c ...저자 등등...
  • 36. $ mv a.txt A.txt Git Repository (non-bare) Working Directory (.) a.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 4fa8 Index (.git/index) a.txt blob e427 a.txt e427 tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c 13년 10월 17일 목요일 blob e965 blob e965 a.txt tree 9d1c ...저자 등등...
  • 37. $ mv a.txt A.txt Git Repository (non-bare) Working Directory (.) A.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 4fa8 Index (.git/index) a.txt blob e427 a.txt e427 tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c 13년 10월 17일 목요일 blob e965 blob e965 a.txt tree 9d1c ...저자 등등...
  • 38. $ mv a.txt A.txt $ git rm --cached a.txt Git Repository (non-bare) Working Directory (.) A.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 4fa8 Index (.git/index) a.txt blob e427 a.txt e427 tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c 13년 10월 17일 목요일 blob e965 blob e965 a.txt tree 9d1c ...저자 등등...
  • 39. $ mv a.txt A.txt $ git rm --cached a.txt Git Repository (non-bare) Working Directory (.) A.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 4fa8 Index (.git/index) blob e427 a.txt tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c 13년 10월 17일 목요일 blob e965 blob e965 a.txt tree 9d1c ...저자 등등...
  • 40. $ mv a.txt A.txt $ git rm --cached a.txt $ git add A.txt Git Repository (non-bare) Working Directory (.) A.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 4fa8 Index (.git/index) blob e427 a.txt tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c 13년 10월 17일 목요일 blob e965 blob e965 a.txt tree 9d1c ...저자 등등...
  • 41. $ mv a.txt A.txt $ git rm --cached a.txt $ git add A.txt Git Repository (non-bare) Working Directory (.) A.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 4fa8 Index (.git/index) A.txt blob e427 a.txt e427 tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c 13년 10월 17일 목요일 blob e965 blob e965 a.txt tree 9d1c ...저자 등등...
  • 42. $ git commit -m ‘Rename a.txt to A.txt’ Git Repository (non-bare) Working Directory (.) A.txt “HELLO” Refs (.git/) HEAD Object Database (.git/objects/) tree 4fa8 Index (.git/index) A.txt blob e427 a.txt e427 tree 06d2 blob e427 blob e427 a.txt “HELLO” blob 216e b.txt master commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” commit 8511 tree 06d2 parent 73d3 ...저자 등등... “Update a.txt” commit 73d3 tree 9d1c 13년 10월 17일 목요일 blob e965 blob e965 a.txt tree 9d1c ...저자 등등...
  • 43. $ git commit -m ‘Rename a.txt to A.txt’ Git Repository (non-bare) Working Directory (.) A.txt “HELLO” HEAD Object Database (.git/objects/) tree 8808 Index (.git/index) A.txt Refs (.git/) blob e427 A.txt e427 master commit 2825 tree 8808 parent 8511 ...저자 등등... “Rename a.txt to...” blob e427 a.txt commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” tree 06d2 commit 8511 tree 06d2 parent 73d3 tree 4fa8 blob e427 “HELLO” 13년 10월 17일 목요일 blob e427 a.txt
  • 44. $ git commit -m ‘Rename a.txt to A.txt’ Git Repository (non-bare) Working Directory (.) A.txt “HELLO” HEAD Object Database (.git/objects/) tree 8808 Index (.git/index) A.txt Refs (.git/) blob e427 A.txt e427 master commit 2825 tree 8808 parent 8511 ...저자 등등... “Rename a.txt to...” blob e427 a.txt commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” tree 06d2 commit 8511 tree 06d2 parent 73d3 tree 4fa8 blob e427 “HELLO” 13년 10월 17일 목요일 blob e427 a.txt
  • 45. $ mkdir src Git Repository (non-bare) Working Directory (.) A.txt “HELLO” HEAD Object Database (.git/objects/) tree 8808 Index (.git/index) A.txt Refs (.git/) blob e427 A.txt e427 master commit 2825 tree 8808 parent 8511 ...저자 등등... “Rename a.txt to...” blob e427 a.txt commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” tree 06d2 commit 8511 tree 06d2 parent 73d3 tree 4fa8 blob e427 “HELLO” 13년 10월 17일 목요일 blob e427 a.txt
  • 46. $ mkdir src $ git mv A.txt src/A.txt Git Repository (non-bare) Working Directory (.) src/ A.txt HEAD Object Database (.git/objects/) “HELLO” tree 8808 Index (.git/index) A.txt Refs (.git/) blob e427 A.txt e427 master commit 2825 tree 8808 parent 8511 ...저자 등등... “Rename a.txt to...” blob e427 a.txt commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” tree 06d2 commit 8511 tree 06d2 parent 73d3 tree 4fa8 blob e427 “HELLO” 13년 10월 17일 목요일 blob e427 a.txt
  • 47. $ mkdir src $ git mv A.txt src/A.txt Git Repository (non-bare) Working Directory (.) src/ src/A.txt HEAD Object Database (.git/objects/) “HELLO” tree 8808 Index (.git/index) A.txt Refs (.git/) blob e427 A.txt e427 master commit 2825 tree 8808 parent 8511 ...저자 등등... “Rename a.txt to...” blob e427 a.txt commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” tree 06d2 commit 8511 tree 06d2 parent 73d3 tree 4fa8 blob e427 “HELLO” 13년 10월 17일 목요일 blob e427 a.txt
  • 48. $ mkdir src $ git mv A.txt src/A.txt $ git commit -m ‘Move A.txt into src’ Git Repository (non-bare) Working Directory (.) src/ src/A.txt HEAD Object Database (.git/objects/) “HELLO” tree 8808 Index (.git/index) src/A.txt Refs (.git/) blob e427 A.txt e427 master commit 2825 tree 8808 parent 8511 ...저자 등등... “Rename a.txt to...” blob e427 a.txt commit 8bc3 tree 4fa8 parent 8511 ...저자 등등... “Delete b.txt” tree 06d2 commit 8511 tree 06d2 parent 73d3 tree 4fa8 blob e427 “HELLO” 13년 10월 17일 목요일 blob e427 a.txt
  • 49. $ mkdir src $ git mv A.txt src/A.txt $ git commit -m ‘Move A.txt into src’ Git Repository (non-bare) Working Directory (.) src/ src/A.txt HEAD Object Database (.git/objects/) “HELLO” tree 2dc1 Index (.git/index) src/A.txt Refs (.git/) tree 8808 src/ e427 tree 8808 blob e427 blob e427 A.txt “HELLO” tree 4fa8 13년 10월 17일 목요일 blob e427 a.txt master commit 3183 tree 2dc1 parent 2825 ...저자 등등... “Move a.txt into src” commit 2825 tree 8808 parent 8511 ...저자 등등... “Rename a.txt to...” commit 8bc3 tree 4fa8 parent 8511
  • 50. $ mkdir src $ git mv A.txt src/A.txt $ git commit -m ‘Move A.txt into src’ Git Repository (non-bare) Working Directory (.) src/ src/A.txt HEAD Object Database (.git/objects/) “HELLO” tree 2dc1 Index (.git/index) src/A.txt Refs (.git/) tree 8808 src/ e427 tree 8808 blob e427 blob e427 A.txt “HELLO” tree 4fa8 13년 10월 17일 목요일 blob e427 a.txt master commit 3183 tree 2dc1 parent 2825 ...저자 등등... “Move a.txt into src” commit 2825 tree 8808 parent 8511 ...저자 등등... “Rename a.txt to...” commit 8bc3 tree 4fa8 parent 8511
  • 51. $ mkdir src $ git mv A.txt src/A.txt $ git commit -m ‘Move A.txt into src’ Git Repository (non-bare) Working Directory (.) src/ src/A.txt “HELLO” Index (.git/index) src/A.txt e427 Refs (.git/) HEAD Object Database (.git/objects/) src/ 브랜치와 머지 tree 2dc1 tree 8808 src/ tree 8808 blob e427 HELLO “HELLO” blob e427 A.txt A.txt tree 4fa8 13년 10월 17일 목요일 blob a.txt a.txt e427 master commit 3183 tree Move 2dc1 parent A.txt... 2825 ...저자 등등... “Move a.txt into src” commit 2825 treeRename 8808 parent 8511 a.txt... ...저자 등등... “Rename a.txt to...” commit 8bc3 tree 4fa8 Delete parent 8511
  • 53. $ git co -b branch-1 t5 E t4 D t3 C b2 t2 B b1 t1 A b3 13년 10월 17일 목요일 branch-1 master HEAD
  • 54. $ git co -b branch-1 t5 E t4 D t3 C b2 t2 B b1 t1 A b3 13년 10월 17일 목요일 branch-1 HEAD master
  • 55. $ git commit b2 t2 t5 F E t4 D t3 C b2 t2 B b1 t1 A b3 13년 10월 17일 목요일 branch-1 HEAD master
  • 56. $ git commit b2 t2 t5 F branch-1 HEAD E master t4 D t3 C b2 t2 B b1 t1 A b3 13년 10월 17일 목요일
  • 57. $ git co master b2 t2 t5 F branch-1 HEAD E master t4 D t3 C b2 t2 B b1 t1 A b3 13년 10월 17일 목요일
  • 58. $ git co master b2 t2 t5 F branch-1 E master t4 D t3 C b2 t2 B b1 t1 A b3 13년 10월 17일 목요일 HEAD
  • 59. $ git merge branch-1 b2 t2 t5 F branch-1 E master t4 D t3 C b2 t2 B b1 t1 A b3 13년 10월 17일 목요일 HEAD 상황1: 머지할 브랜 치가 현재 브랜치의 모든 커밋을 포함함
  • 60. $ git merge branch-1 b2 t2 t5 F E t4 D t3 C b2 t2 B b1 t1 A b3 13년 10월 17일 목요일 branch-1 master HEAD Fast-Forward
  • 61. $ git merge branch-1 master branch-1 b6 G F t6 t5 E t4 b3 13년 10월 17일 목요일 D t3 C t7 HEAD b7 상황2: 머지할 브랜 치가 현재 브랜치의 모든 커밋을 포함하 지는 않음
  • 62. $ git merge branch-1 master branch-1 b6 G F t6 t5 E t4 b3 13년 10월 17일 목요일 D t3 C t7 HEAD b7 상황2: 머지할 브랜 치가 현재 브랜치의 모든 커밋을 포함하 지는 않음
  • 63. $ git merge branch-1 b8 E..F와 E..G를 머지 H t8 master branch-1 b6 G F t6 t5 t7 HEAD b7 E F와 G의 공통조상 t4 b3 13년 10월 17일 목요일 D t3 C
  • 64. $ git merge branch-1 b8 E..F와 E..G를 머지 master H t8 HEAD branch-1 b6 G F t6 t5 t7 b7 E F와 G의 공통조상 t4 b3 13년 10월 17일 목요일 D t3 C
  • 66. $ git rebase master b8 F’ t8 master branch-1 HEAD b6 G F t6 t5 E t4 b3 13년 10월 17일 목요일 D t3 C t7 b7
  • 67. $ git rebase master b8 HEAD b6 F’ t8 branch-1 G F t6 t5 E t4 b3 13년 10월 17일 목요일 master D t3 C t7 b7
  • 68. $ git reflog expire --all --expire=0 $ git prune b8 HEAD b6 F’ t8 branch-1 G F t6 t5 E t4 b3 13년 10월 17일 목요일 master D t3 C t7 b7
  • 69. $ git reflog expire --all --expire=0 $ git prune F’ b8 HEAD branch-1 F b6 G E D b3 C b2 B b1 13년 10월 17일 목요일 master A b7
  • 70. $ git reflog expire --all --expire=0 $ git prune F’ b8 HEAD branch-1 master G E D b3 b2 B b1 13년 10월 17일 목요일 C A b7
  • 71. $ git push origin master:master F’ b8 HEAD ref를 보낸다. branch-1 G E master master G b7 PUSH PULL E b7 b3 C b3 b2 B b2 가져온 ref가 D “완전하도록” 필요한 C 모든 object를 보낸다. B b1 A b1 A D 13년 10월 17일 목요일
  • 72. $ git pull origin branch-2:master Local master FETCH_HEAD G H E F D ref를 가져온다 가져온 ref가 “완전하도록” 필요한 모든 object 를 가져온다. Remote master G H E F D C C B B A 13년 10월 17일 목요일 branch-2 A
  • 73. $ git pull origin branch-2:master Local Remote master I master FETCH_HEAD G H F G H E E F D D C C B B 13년 10월 17일 목요일 A A branch-2
  • 74. $ git pull origin branch-2:master Local Remote master master I FETCH_HEAD G H F G H E E F D D C C B B 13년 10월 17일 목요일 A A branch-2
  • 75. $ git pull origin branch-2:master Local Remote master master I FETCH_HEAD G H E F H’ G H’ E F D D C C B B 13년 10월 17일 목요일 A A branch-2 push -f
  • 76. $ git pull origin branch-2:master Local Remote master J master I FETCH_HEAD G H E F H’ G H’ E F D D C C B B 13년 10월 17일 목요일 A A branch-2 push -f
  • 77. $ git pull origin branch-2:master Local Remote master J master I FETCH_HEAD G H E F H’ G H’ E F D D C C B B 13년 10월 17일 목요일 A A branch-2 push -f