-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
237 lines (219 loc) · 9.5 KB
/
index.html
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>reveal.js</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/night.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<img src="https://git-scm.com/images/logos/downloads/Git-Icon-1788C.png" width="15%" height="15%">
<h1 style="font-size: 3.5em;">Git Presentation</h1>
for newbies and advanced users
</section>
<section>
<section>
<h2>What is Git (really) ? 🤔</h2>
</section>
<section>
Free and open source version control tool, originally created to manage Linux versions
</section>
<section>
Lets you update, revert, delete, navigate history, tag changes, manage remote repositories, etc.
</section>
<section>
<p>Famous web-based remotes:</p>
<a href="https://www.gitlab.com" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/GitLab_Logo.svg/2000px-GitLab_Logo.svg.png" alt="Gitlab" width="43%" height="43%"></a>
<a href="https://www.github.com" target="_blank"><img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="Github" width="40%" height="40%"></a>
</section>
</section>
<section>
<h2>The Git logic</h2>
<p>(where most people get lost)</p>
</section>
<section id="fragments">
<h3>Different "Spaces" managed by Git</h3>
<p class="fragment">Working Directory - Stage - Local Repository - Remote Repository</p>
</section>
<section>
<section>
<h3>Stage</h3>
</section>
<section id="fragments">
<p>Git can interact with your files to create an Index of the overall changes</p>
<p class="fragment">This index is called the Stage</p>
<img src="./git-working-staging-noarrow.png" alt="git-working-staging-noarrow" class="fragment">
</section>
<section id="fragments">
<p>You can add file changes to the Stage with </p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git add <file/directory>
</code></pre>
<small class="fragment">unchanged files are ignored</small>
<p class="fragment">And remove them with </p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git reset <nothing/directory>
</code></pre>
<img class="fragment" src="./git-working-staging-arrow.png" alt="git-working-staging-arrow.png" width="40%" height="40%">
<small class="fragment">If nothing is staged, git finds changes by comparing to the last commit</small>
</section>
<section id="fragments">
How can we reset <b>nothing</b> ? How does that make sense?
<p class="fragment">When we reset without arguments, we revert to a previous commit (by default the HEAD)</p>
</section>
</section>
<section>
<section>
<h3>Local repository</h3>
</section>
<section id="fragments">
<p>I talked about <b>commits</b> before, but what is that ?</p>
<p class="fragment">A commit is a bundle of changes (the current Stage), to which is added a log message, an id, etc.</p>
<p class="fragment">Commits reside in your Local Repository, which contains every commit ever added</p>
<img class="fragment" src="./git-working-local-noarrow.png" width="80%" height="80%">
</section>
<section id="fragments">
<p>You can move the current stage to the local repository with</p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git commit <nothing/-m 'message'>
</code></pre>
<p>And move your changes back from the local repository to the stage with</p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git reset <target commit SHA/commit path relative to HEAD>
</code></pre>
</section>
<section>
<img src="./git-working-local-arrow.png" width="80%" height="80%">
</section>
</section>
<section>
<section>
<h3>Ok that's great, but what is that Github I keep hearing about ?</h3>
</section>
<section id="fragments">
<p>Github, Gitlab, Bitbucket, etc. are remotes, the 4th kind of Space</p>
<img class="fragment" src="./git-spaces-noarrow.png" width="80%" height="80%">
</section>
<section id="fragments">
<p>Your current Local Repository is linked to at least one Remote (origin), to which you can add a commit with</p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git push <remote> <branch>
</code></pre>
<small class="fragment">We'll see what a branch is in a second</small>
<p class="fragment">You can also retrieve the state of the remote with</p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git fetch <--all for all tracked remotes>
</code></pre>
<p class="fragment">And then apply change from the desired branch with</p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git merge <remote/branch>
</code></pre>
</section>
<section id="fragments">
<p>The process of retrieving and applying changes seems tideous, any shorthand ?</p>
<p class="fragment">YES</p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git pull <remote> <branch>
</code></pre>
</section>
<section>
<img src="./git-spaces.png" width="100%" height="100%">
</section>
</section>
<section>
<section>
<h3>On the subject of branches</h3>
</section>
<section id="fragments">
<p>Git allows you to have multiple instances of a local repository, also called branches</p>
<p class="fragment">This allows you to have multiple versions of a single project</p>
</section>
<section id="fragments">
<p>You can create a branch with</p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git checkout -b <branchname>
</code></pre>
<p class="fragment">Or access a branch with</p>
<pre class="fragment"><code class="shell" data-trim contenteditable>
git checkout <branchname>
</code></pre>
</section>
<section>
<p>Why bother about branches? Can't everybody just push their commits to master ?</p>
</section>
<section id="fragments">
<p>We use GitFlow at Dynamicly</p>
<img class="fragment" src="./git-flow-branchs.png" width="80%" height="80%">
</section>
<section id="fragments">
<p>Every feature is a new branch</p>
<p class="fragment">Completed features get reviewed, then merged to development</p>
<p class="fragment">This allows us to manage released features, version tag master depending on the available features, make sure no side effects are caused before release, etc.</p>
</section>
</section>
<section>
<section>
<p>What did we learn today ?</p>
</section>
<section id="fragments">
<p>Git allows you to manage 4 Spaces: Working Directory, Staging, Local Repository, Remote Repository</p>
<p class="fragment">Repositories also have branches, which are kind of different versions</p>
<p class="fragment">Everything is undoable and redoable with git, you have never "fucked up" the repo (unless you force push, but at that point you are looking for trouble). See: <a href="https://ohshitgit.com/" target="_blank">ohshitgit</a></p>
</section>
</section>
<section>
<p>That's it ! You are now git masters 😎</p>
</section>
<section>
<section id="now">
<p>All this time spent in the terminal makes me hate myself, any tips ?</p>
</section>
<section id="fragments">
<p>Use Iterm2 on MacOS</p>
<img src="./iterm2.png" width="80%" height="80%">
<small>For Windows I don't know guys, I haven't touched Windows in 5 years</small>
</section>
<section id="fragments">
<p>Wow my terminal has a lot more features, but how can I make it EVEN BETTER ??</p>
</section>
<section id="fragments">
<p>Use Zsh (better shell, with a lot of baked in features)</p>
<p class="fragment">Install Oh-My-Zsh to add plugins and themes</p>
<!-- <video width="320" height="240" controls>
<source src="./what-does-zsh-look-like.mov" type="video/mov">
</video> -->
</section>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>