-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
554 lines (472 loc) · 16.7 KB
/
index.html
File metadata and controls
554 lines (472 loc) · 16.7 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
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Git(Hub) workshop for LOCI</title>
<meta name="description" content="How to use Git and GitHub effectively">
<meta name="author" content="Johannes Koenig-Schindelin">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/moon.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<style type="text/css">
.bold { color: #65a4e3; }
.reveal p { font-size: 40pt; }
.reveal section .icon { border: 0px; margin-bottom: 0; width: .9em; color: rgba(0, 0, 0, 1); }
.gallery img { border: 0px; width: auto; height: 5em; }
</style>
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<div style="float: left;"><img src="images/git.png" /> </div>
<h1>Using Git and GitHub</h1>
<h3>Like, effectively</h3>
<p>
<small>Curtis Rueden, Mark Hiner & Johannes Koenig-Schindelin</small>
</p>
</section>
<section>
<section>
<h3>Prelude:<br />Why use a version control system?</h3>
<p style="font-family: Arial; font-size: 250pt; color: #8080ff">?</p>
</section>
<section>
<h3>Common scientific development workflow</h3>
<ul>
<li class="fragment">Email</li>
<li class="fragment">Hack some code</li>
<li class="fragment">Meeting</li>
<li class="fragment">Hack some code</li>
<li class="fragment">Student needs something</li>
<li class="fragment">Hack some code</li>
<li class="fragment">It is broken?</li>
<li class="fragment">WTF?</li>
<li class="fragment">???</li>
<li class="fragment">Boohooooo!</li>
</ul>
</section>
<section>
<h3>Common scientific development workflow, version II</h3>
<ul>
<li class="fragment">Coffee</li>
<li class="fragment">Make a change in the code</li>
<li class="fragment">Test</li>
<li class="fragment">Make another change in the code</li>
<li class="fragment">Test</li>
<li class="fragment">Send the code to a collaborator</li>
<li class="fragment">It no longer works!</li>
<li class="fragment">WTF?</li>
<li class="fragment">???</li>
<li class="fragment">Boohooooo!</li>
</ul>
</section>
<section>
<h3>Less common scientific development workflow</h3>
<ul>
<li class="fragment">Make changes in the code</li>
<li class="fragment">It works, great!</li>
<li class="fragment">Collaborator made different changes in the code!</li>
<li class="fragment">How to reconcile?</li>
<li class="fragment">???</li>
<li class="fragment">Boohooooo!</li>
</ul>
</section>
<section>
<h3>Most common development workflow</h3>
<ul>
<li class="fragment">Provide code to collaborator</li>
<li class="fragment">Six months later...</li>
<li class="fragment">Get mail saying: your code is broken</li>
<li class="fragment">Test verifies: is broken</li>
<li class="fragment">Used to work!</li>
<li class="fragment">Where is the working version?</li>
<li class="fragment">Aargh!</li>
<li class="fragment">Boohooooo!</li>
</ul>
</section>
</section>
<section>
<h1>Overview</h1>
<ul>
<li class="fragment">Getting started</li>
<li class="fragment">Diffs</li>
<li class="fragment">Commits</li>
<li class="fragment">Commit history</li>
<li class="fragment">Merges</li>
<li class="fragment">Some theory</li>
<li class="fragment">Topic branches</li>
<li class="fragment">Bisecting</li>
<li class="fragment">Forking</li>
<li class="fragment">Pull Requests</li>
<li class="fragment">GitHub tricks</li>
</ul>
</section>
<section>
<section>
<h3>Getting started</h3>
<a href="http://git-scm.com/">http://git-scm.com/</a>
</section>
<section>
<h3>Cloning the <i>loci-scripts</i> repository</h3>
<pre>
<code lang="bash" data-trim contenteditable>
$ git clone https://github.com/uw-loci/loci-scripts
Cloning into 'loci-scripts'...
remote: Reusing existing pack: 27, done.
remote: Total 27 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (27/27), done.
Checking connectivity... done.
</code>
</pre>
</section>
</section>
<section>
<section>
<h3>Diffs</h3>
<pre>
<code lang="diff" data-trim contenteditable>
diff --git a/anthem.txt b/anthem.txt
new file mode 100644
index 0000000..46ea613
--- /dev/null
+++ b/anthem.txt
@@ -0,0 +1,9 @@
+Lord, grant that Marshal Wade
+May, by thy mighty aid,
+Victory bring!
+
+May he sedition hush
+And, like a torrent, rush
+Rebellious Scots to crush.
+
+God save the King!
</code>
</pre>
</section>
<section>
<h3>Diffs, part II</h3>
<pre>
<code lang="diff" data-trim contenteditable>
diff --git a/anthem.txt b/anthem.txt
index 46ea613..d920528 100644
--- a/anthem.txt
+++ b/anthem.txt
@@ -7,3 +7,5 @@ And, like a torrent, rush
Rebellious Scots to crush.
God save the King!
+
+(melody: My country 'tis of thee)
</code>
</pre>
</section>
</section>
<section>
<section>
<h3>Commits</h3>
<pre>
<code lang="bash" data-trim contenteditable>
$ git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
hello.txt
nothing added to commit but untracked files present (use "git add" to track)
$ git add hello.txt
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: hello.txt
</code>
</pre>
</section>
<section>
<h3>Commit messages</h3>
<pre>
Short summary (50 characters or less)
More detailed explanatory text ("commit message body") after an empty
line, with additional information that cannot be inferred easily from
the diff, e.g. what bug this solves, who reported the issue.
Wrap it to 72 characters per line.
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
generated by commands like git merge and git revert.
Separate paragraphs with blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded by a
single space, with blank lines in between, but conventions vary here
- Use a hanging indent
</pre>
<div style="font-family: Arial;
font-size: 16pt; float: right;">Source: <a href="http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html">http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html</a></div>
</section>
<section>
<h3>A commit reflects a <i>revision</i></h3>
<p class="fragment">... that is, a <u>working</u> revision</p>
<p class="fragment">... i.e. not, <b>never <span style="color: red;">ever</span></b> <tt>Many changes...</tt>!!! Good example for a bad example: <a href="https://github.com/imagej/imagej/commit/ad125915d">https://github.com/imagej/imagej/commit/ad125915d</a></p>
</section>
</section>
<section>
<section>
<h3>Commit history</h3>
<img src="images/git-history.png" />
</section>
<section>
<h3>"git log"</h3>
<ul>
<li><pre>git log</pre></li>
<li class="fragment"><pre>git log -p</pre></li>
<li class="fragment"><pre>git log origin/master</pre></li>
<li class="fragment"><pre>git log bin/</pre></li>
<li class="fragment"><pre>git log -SXmx</pre></li>
<li class="fragment"><pre>git log --author=Curtis</pre></li>
<li class="fragment"><pre>git log -3</pre></li>
<li class="fragment"><pre>git log HEAD^..HEAD^2</pre></li>
</ul>
</section>
</section>
<section>
<section>
<h3>Merges</h3>
<pre>
<code lang="bash" data-trim contenteditable>
$ git merge origin/tutorial
Auto-merging bin/prairie-backup.sh
CONFLICT (content): Merge conflict in bin/prairie-backup.sh
Recorded preimage for 'bin/prairie-backup.sh'
Automatic merge failed; fix conflicts and then commit the result.
$ git status
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: bin/prairie-backup.sh
no changes added to commit (use "git add" and/or "git commit -a")
</code>
</pre>
</section>
<section>
<h3>Merge conflicts</h3>
<pre>
# compress Prairie dataset to ZIP file
echo
echo "Compressing '$datasetFullName' to ZIP..."
if [ -e "$zipPath" ];
then
# ZIP file already exists; skip this dataset
echo "ZIP file already exists. Moving on..."
continue
fi
<span style="color: #ffc080;"><<<<<<< HEAD</span>
# make the directory
mkdir -p "${zipDir:-1}"
<span style="color: #8080ff;">=======</span>
mkdir -p "$zipDir"
<span style="color: #ff80ff;">>>>>>>> master</span>
(cd "$datasetBase" && zip -r9 "$zipPath" "$datasetName" > /dev/null)
# delete uncompressed Prairie dataset
echo
echo "Deleting '$datasetFullName'..."
</pre>
</section>
</section>
<section>
<section>
<h3>Some theory</h3>
</section>
<section>
<h3>"content-addressable database"</h3>
<table style="font-size: 20pt;" border=0>
<td><pre style="font-size: 20pt;">Mahna mahna<br />do dooh bee doo doo</pre></td>
<td class="fragment" valign=center>=></span>
<td class="fragment" valign=center>a2a100025d1516bab79163fe862475d7bd010ef8</span>
</table>
<div class="fragment"><i>Everything</i> is a content-addressable object, identified by a <i>hash</i> of itself</div>
</section>
<section>
<h3><i>Everything</i> is an object</h3>
<ul>
<li class="fragment">a file is an object</li>
<li class="fragment">a directory is a list of files, i.e. an object</li>
<li class="fragment">a commit is a top-level directory and a list of parent commits, i.e. an object</li>
</ul>
<span class="fragment"><br />Surprising fact: commits do <i>not</i> store changes!</span>
</section>
<section>
<h3><i>Everything?</i></h3>
Not quite: HEAD is mutable. Mutable things cannot be objects.
</section>
<section>
<h3>The commit graph</h3>
<img src="images/commit-graph.svg" />
</section>
</section>
<section>
<section>
<h3>Topic branches</h3>
<pre>
<code lang="bash" data-trim contenteditable>
$ git checkout -b my-cool-topic origin/master
Switched to a new branch 'my-cool-topic'
...
$ git push origin HEAD
Counting objects: 14, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (8/8), 913 bytes | 0 bytes/s, done.
Total 8 (delta 2), reused 0 (delta 0)
To origin
* [new branch] HEAD -> my-cool-topic
</code>
</pre>
</section>
<section>
<h3>Rewriting branches</h3>
<pre>
<code lang="bash" data-trim contenteditable>
$ git rebase -i origin/master
Successfully rebased and updated refs/heads/master.
$ git push origin +HEAD
Counting objects: 17, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (17/17), 12.75 KiB | 0 bytes/s, done.
Total 17 (delta 3), reused 0 (delta 0)
To origin
+ 597967a...deadbeef HEAD^ -> master (forced update)
</code>
</pre>
</section>
<section>
<h3>"Interactive rebase"</h3>
<pre>
<span style="color: #aca100;">pick</span> <span style="color: #55adbe;">c5ad950</span> <span style="color: #bf08d2;">Insert a comment</span>
<span style="color: #aca100;">pick</span> <span style="color: #55adbe;">1253d09</span> <span style="color: #bf08d2;">Fix typo</span>
<span style="color: #aca100;">pick</span> <span style="color: #55adbe;">dbf553c</span> <span style="color: #bf08d2;">Add support for XYZ</span>
<span style="color: #55adbe;"># Rebase 152ebdc..dbf553c onto 152ebdc
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell</span>
</pre>
</section>
<section>
<h3>Fixup commits</h3>
<pre>
<code lang="bash" data-trim contenteditable>
$ git add bin/
$ git commit --fixup HEAD^^
[master b6c875c] fixup! Insert a comment
1 file changed, 1 insertion(+)
</code>
</pre>
</section>
</section>
<section>
<h3>Bisecting</h3>
<pre>
<code lang="bash" data-trim contenteditable>
$ git bisect start
$ git bisect bad HEAD
$ git bisect good HEAD@{1.day.ago}
... test ...
$ git bisect good
... test ...
$ git bisect bad
... rinse and repeat ...
... find out bad commit ...
$ git bisect reset
</code>
</pre>
</section>
<section>
<section>
<h3>Forking</h3>
<img src="images/github-fork.png" />
</section>
<section>
<h3>Network</h3>
<img src="images/github-network.png" />
</section>
</section>
<section>
<h3>Pull Requests</h3>
<img src="images/i-can-haz-pull-request.png" />
</section>
<section>
<section>
<h3>GitHub tricks</h3>
<ul>
<li>
Looking at individual commits:<br />
<a href="https://github.com/uw-loci/loci-scripts/commit/HEAD^">https://github.com/uw-loci/loci-scripts/commit/HEAD^</a>
</li>
<li class="fragment">
Looking at topic branches:<br />
<a href="https://github.com/uw-loci/loci-scripts/compare/master...tutorial">https://github.com/uw-loci/loci-scripts/compare/master...tutorial</a>
</li>
<li class="fragment">'t'</li>
<li class="fragment">Click on line numbers</li>
<li class="fragment">'y'</li>
<li class="fragment">'?'</li>
</ul>
</section>
<section>
<h3>README.md</h3>
<a href="https://help.github.com/articles/github-flavored-markdown">https://help.github.com/articles/github-flavored-markdown</a>
</section>
<section>
<h3><i>gh-pages</i></h3>
See e.g. <a href="http://scijava.github.io/">http://scijava.github.io/</a>, backed by <a href="https://github.com/scijava/scijava.github.com">https://github.com/scijava/scijava.github.com</a>.
</section>
</section>
<section>
<h1>Thank you!</h1>
<p>ImageJ2 team:</p>
<p class="gallery"><img src="images/kevin-eliceiri.jpg" /><img src="images/curtis.jpg" /><img src="images/dschos-pony.jpg" /><img src="images/mark-hiner.jpg" /></p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>