git HEAD
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk A
HASH A
Hunk B
Hunk C
HASH B
Hunk D
HASH C
Slide 37
Slide 37 text
git HEAD
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk A
HASH A
Hunk B
Hunk C
HASH B
Hunk D
HASH C
HEAD
Slide 38
Slide 38 text
git HEAD
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk A
HASH A
Hunk B
Hunk C
HASH B
Hunk D
HASH C
HEAD
HEAD^
Slide 39
Slide 39 text
git HEAD
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk A
HASH A
Hunk B
Hunk C
HASH B
Hunk D
HASH C
HEAD
HEAD^
HEAD^^
Slide 40
Slide 40 text
git reset --mixed 重置
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk D
HASH C
Hunk A
HASH A
Hunk B
Hunk C
HASH B
Slide 41
Slide 41 text
git reset --mixed 重置
Local
Local Repo/
Master
Staging
Area
Workspace
—mixed HEAD^
Hunk D
HASH C
Hunk A
HASH A
Hunk B
Hunk C
HASH B
Slide 42
Slide 42 text
git reset --mixed 重置
Local
Local Repo/
Master
Staging
Area
Workspace
—mixed HEAD^
Hunk D
Hunk A
HASH A
Hunk B
Hunk C
HASH B
Slide 43
Slide 43 text
git reset --soft 重置
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk D
HASH C
Hunk A
HASH A
Hunk B
Hunk C
HASH B
Slide 44
Slide 44 text
git reset --soft 重置
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk D
HASH C
Hunk A
HASH A
Hunk B
Hunk C
HASH B
—soft HEAD^
Slide 45
Slide 45 text
git reset --soft 重置
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk A
HASH A
Hunk B
Hunk C
HASH B
—soft HEAD^
Hunk D
Slide 46
Slide 46 text
git reset --hard 重置
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk D
HASH C
Hunk A
HASH A
Hunk B
Hunk C
HASH B
Slide 47
Slide 47 text
git reset --hard 重置
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk D
HASH C
Hunk A
HASH A
Hunk B
Hunk C
HASH B
git reset —hard HEAD^
Slide 48
Slide 48 text
git reset --hard 重置
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk D
Hunk A
HASH A
Hunk B
Hunk C
HASH B
git reset —hard HEAD^
Slide 49
Slide 49 text
git reset --hard 重置
Local
Local Repo/
Master
Staging
Area
Workspace
Hunk A
HASH A
Hunk B
Hunk C
HASH B
git reset —hard HEAD^
Slide 50
Slide 50 text
git reset […] 重置
Local
Local Repo/
Master
Staging
Area
Workspace
—mixed HEAD^
git reset —hard HEAD^
—soft HEAD^
Slide 51
Slide 51 text
發佈到遠端 git server
Slide 52
Slide 52 text
發佈到遠端 git server
Slide 53
Slide 53 text
發佈到遠端 git server
Slide 54
Slide 54 text
git remote add origin git@git..
Local
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
Slide 55
Slide 55 text
git remote add origin git@git..
Local Remote
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
Slide 56
Slide 56 text
git remote add origin git@git..
Local Remote
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
Slide 57
Slide 57 text
git remote add origin git@git..
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
Slide 58
Slide 58 text
git remote add origin git@git..
Slide 59
Slide 59 text
git remote add origin git@git..
Slide 60
Slide 60 text
git push -u origin master
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
Slide 61
Slide 61 text
git push -u origin master
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
git push
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
Slide 62
Slide 62 text
git push -u origin master
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
git push
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
Slide 63
Slide 63 text
git push -u origin master
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
git push
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
Slide 64
Slide 64 text
git push -u origin master
Slide 65
Slide 65 text
git push -u origin master
Slide 66
Slide 66 text
git fetch
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
Slide 67
Slide 67 text
git fetch
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
HASH D
HASH C
HASH A
HASH B
HASH D
Slide 68
Slide 68 text
git fetch
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
git fetch
HASH D
HASH C
HASH A
HASH B
HASH D
Slide 69
Slide 69 text
git fetch
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
git fetch
HASH C
HASH A
HASH B
HASH D HASH D
Slide 70
Slide 70 text
GIT BRANCH
Slide 71
Slide 71 text
git branch
Local Remote
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
Remote Repo/
Master
Remote Repo/
Master
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
HASH D HASH D
Slide 72
Slide 72 text
git branch
Local Remote
Local Repo/
Master
HASH C
HASH A
HASH B
Slide 73
Slide 73 text
git branch
Local Remote
Local Repo/
Master
HASH C
HASH A
HASH B
Slide 74
Slide 74 text
git branch
Local Remote
Local Repo/
Master
Local Repo/
Develop
HASH C
HASH A
HASH B
git branch
develop
Slide 75
Slide 75 text
git branch
Local Remote
Local Repo/
Master
Local Repo/
Develop
HASH C
HASH A
HASH B
git branch
develop
HASH C
HASH A
HASH B
Slide 76
Slide 76 text
git branch
Local Remote
Local Repo/
Master
Local Repo/
Develop
HASH C
HASH A
HASH B
git branch
develop
HASH C
HASH A
HASH B
Slide 77
Slide 77 text
git branch
Local Remote
Local Repo/
Master
Local Repo/
Develop
HASH C
HASH A
HASH B
git branch
develop
HASH C
HASH A
HASH B
Slide 78
Slide 78 text
git branch
Local Remote
Local Repo/
Master
Local Repo/
Develop
HASH C
HASH A
HASH B
git branch
develop
HASH C
HASH A
HASH B
A B C
Slide 79
Slide 79 text
git branch
Local Remote
Local Repo/
Master
Local Repo/
Develop
HASH C
HASH A
HASH B
git branch
develop
HASH C
HASH A
HASH B
A B C
Master (HEAD)
Slide 80
Slide 80 text
git branch
Local Remote
Local Repo/
Master
Local Repo/
Develop
HASH C
HASH A
HASH B
git branch
develop
HASH C
HASH A
HASH B
A B C
Master
Develop
(HEAD)
Slide 81
Slide 81 text
Local
git checkout -b [name]
A B C
Master (HEAD)
Slide 82
Slide 82 text
Local
git checkout -b [name]
A B C
Master
Develop
(HEAD)
Slide 83
Slide 83 text
Local
git checkout -b [name]
A B C
Master
Develop (HEAD)
Slide 84
Slide 84 text
Local
git checkout -b [name]
A B C
Master
Develop (HEAD)
Slide 85
Slide 85 text
Local
git checkout -b [name]
A B C
Master
Develop (HEAD)
D
Slide 86
Slide 86 text
Local
git checkout -b [name]
A B C
Master
Develop (HEAD)
D
Slide 87
Slide 87 text
git merge []
Slide 88
Slide 88 text
git merge []
Slide 89
Slide 89 text
Local
git merge develop --no-ff
A B C
Develop
Master (HEAD)
D E
Slide 90
Slide 90 text
Local
git merge develop --no-ff
A B C
Develop
Master (HEAD)
D E
F
Slide 91
Slide 91 text
Local
git merge develop --no-ff
A B C
Develop
Master (HEAD)
D E
F
Slide 92
Slide 92 text
Local
git merge develop --ff (fast-forward)
A B C
Develop
Master (HEAD)
D E
Slide 93
Slide 93 text
Local
git merge develop --ff (fast-forward)
A B C
Develop
Master (HEAD)
D E
Slide 94
Slide 94 text
Local
git merge develop
A B C
Develop
Master (HEAD)
D
Slide 95
Slide 95 text
Local
git merge develop
A B C
Develop
Master (HEAD)
D
Slide 96
Slide 96 text
Local
git merge develop
A B C
Develop
Master (HEAD)
D E
F
Slide 97
Slide 97 text
Local
git merge develop
A B C
Develop
Master (HEAD)
D E
G
F
Slide 98
Slide 98 text
Local
git merge develop
A B C
Develop
Master (HEAD)
D E
G
F
Slide 99
Slide 99 text
Local
git merge develop
A B C
Develop
Master (HEAD)
D E
G
F
只能進⾏行行 no-ff
Slide 100
Slide 100 text
git rebase develop
Slide 101
Slide 101 text
git rebase develop
Slide 102
Slide 102 text
git rebase develop
Slide 103
Slide 103 text
git rebase develop
Slide 104
Slide 104 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F
base
G
Slide 105
Slide 105 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F G
base
Slide 106
Slide 106 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F G
base
Slide 107
Slide 107 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F
重新計算差異異
G
base
Slide 108
Slide 108 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F
F'
重新計算差異異
G
base
Slide 109
Slide 109 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F
F'
重新計算差異異
G
base
Slide 110
Slide 110 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F
F'
重新計算差異異
G
base
Slide 111
Slide 111 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F
F'
重新計算差異異
G
base G'
Slide 112
Slide 112 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F
F'
重新計算差異異
G
base G'
Slide 113
Slide 113 text
Local
git rebase develop
A B C
Develop
Master (HEAD)
D E
F
F'
重新計算差異異
G
base G'
Slide 114
Slide 114 text
互動調整
git rebase -i
(--interactive)
Slide 115
Slide 115 text
git merge with remote
Slide 116
Slide 116 text
git clone
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
git clone
Slide 117
Slide 117 text
git merge
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
git fetch
HASH D
HASH C
HASH A
HASH B
HASH D HASH D
HASH D
Slide 118
Slide 118 text
git merge
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
HASH C
HASH A
HASH B
HASH C
HASH A
HASH B
git fetch
HASH D
HASH C
HASH A
HASH B
HASH D HASH D
git merge
HASH D HASH D
Slide 119
Slide 119 text
git pull
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
git fetch
git merge
Slide 120
Slide 120 text
git pull
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
git fetch
git merge
git pull
Slide 121
Slide 121 text
git pull --rebase
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
git fetch
git rebase
Slide 122
Slide 122 text
git pull --rebase
Local Remote
Remote Repo/
Master
Remote Repo/
Master
Local Repo/
Master
Staging
Area
Workspace
git fetch
git rebase
git pull --rebase
Slide 123
Slide 123 text
mouson 從沒有 管控到
陳佑⽵竹 取得變更更的檔案
期間發⽣生些什什麼事?
Slide 124
Slide 124 text
mouson 上傳 Server 由 陳佑⽵竹 取得
Client (mouson) Server Client (陳佑⽵竹)