forked from gdiboston/gdi-intro-github
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·750 lines (651 loc) · 32.6 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
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
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GDI Boston: Intro to Version Control with Git & GitHub</title>
<meta name="description" content="Slides for Girl Develop It Boston's Intro to the Linux Command Line class">
<meta name="author" content="Girl Develop It">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/gdilight.css" id="theme">
<!-- For syntax highlighting -->
<!-- light editor<link rel="stylesheet" href="lib/css/light.css">-->
<!-- dark editor-->
<link rel="stylesheet" href="lib/css/dark.css">
<!-- If use the PDF print sheet so students can print slides-->
<link rel="stylesheet" href="css/print/pdf.css" type="text/css" media="print">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<!-- Opening -->
<section>
<h3>Intro to Version Control with</h3>
<h1>Git & GitHub</h1>
<p></p>
<p>Girl Develop It | Summer 2018</p>
<p>
<small>Find these slides at <a href ="https://github.com/ShaynaCummings/gdi-intro-github">https://github.com/ShaynaCummings/gdi-intro-github</a></small>
</p>
</section>
<!-- Welcome! -->
<section class="hide-pdf">
<h2>Welcome!</h2>
<img src="./img/gdi-boston.jpeg" width="200px" />
<p>Girl Develop It exists to provide affordable and judgment-free opportunities for women interested in learning web and software development.</p>
</section>
<!-- Ground Rules -->
<section class="hide-pdf">
<h2>Ground Rules</h2>
<ul>
<li>This is your time!</li>
<li>Every question is important</li>
<li>Don't get blocked</li>
<li>Help each other</li>
<li>Have fun</li>
</ul>
</section>
<!-- Our Team -->
<section>
<h2>Our Team</h2>
<p class="blue">Thank you to our wonderful TAs!</p>
<ul>
<li>Marissa</li>
<li>Gail</li>
<li>Natalia</li>
</ul>
<p> </p>
<p class="blue">Instructor: </p>
<p>@ShaynaCummings</p>
<p>shayna.cummings@gmail.com</p>
</section>
<section>
<h2>Course materials:</h2>
<p>
<a href='http://github.com/shaynacummings/gdi-intro-github' target="_blank">github.com/shaynacummings/gdi-intro-github</a>
</p>
</section>
<!-- About You -->
<section class="hide-pdf">
<h2>About You</h2>
<ul>
<li>Who are you?</li>
<li>What do you hope to get out of the class?</li>
<li>If you could have any superpower, what would it be?</li>
</ul>
</section>
<!-- Get started -->
<section>
<h2>Tools</h2>
<p>We'll be using the following tools in class today:</p>
<ul>
<li>Command Line Interface:
<ul>
<li>Mac OS: Terminal (pre-installed)</li>
<li>Linux: Terminal (pre-installed)</li>
<li>Windows: <a href="https://babun.github.io/">babun.github.io</a> (Shell based on Cygwin)</li>
</ul>
</li>
<li>Git: install from <a href="http://git-scm.com/downloads" target="_blank">git-scm.com/downloads</a></li>
<li>GitHub: make a free account at <a href="https://github.com" target="_blank">github.com</a></li>
</ul>
</section>
<!-- What we'll cover today -->
<section>
<h2>What we'll cover today</h2>
<ol>
<li>Version control concepts & Git workflow</li>
<li>Setting up a new repository</li>
<li>Basic git commands: adding, committing & pushing change)</li>
<li>Setting up a remote repository, branching & merging</li>
<li>Remote collaboration</li>
<li>Debugging and resolving merge conflicts</li>
</ol>
</section>
<section>
<h2>1. Version control concepts & Git workflow</h2>
</section>
<!-- What is version control? -->
<section>
<h2>Group project woes</h2>
<p>Ever worked on a group paper and ended up with something like this?</p>
<img src="img/finder-window.png">
</section>
<!-- What is version control? -->
<section>
<h2>A little better</h2>
<p>Version history in Google Docs</p>
<img src="img/version-control-docs.png">
</section>
<!-- What is version control? -->
<section>
<h2>What is Version Control?</h2>
<p>Software that allows you (and your team) to do two powerful things:</p>
<br/>
<p><span class="blue">Collaborate</span>: Create anything with other people, from academic papers to entire websites and applications.</p>
<br/>
<p> <span class="blue">Track and revert changes</span>: Ability to see who specifically made what changes and when. Be able to go back to a "snapshot in time" to fix something that went wrong.</p>
</section>
<!-- Version Control Types -->
<section>
<h3>Version Control Types</h3>
<ul>
<li><span class="green">1990s</span>: CVS (Concurrent Version Systems)</li>
<li><span class="green">2000s</span>: SVN (Apache Subversion)</li>
<li><span class="green">2005</span>: Git</li>
</ul>
<br />
<br />
<h4>Centralized Version Control (CVS, SVN)</h4>
<p>There is one central server and each client (person) checks out and commits changes to it</p>
<br/>
<h4>Distributed Version Control (Git, Mercurial)</h4>
<p>Each client (person) has a local copy of the code, which they can then reconcile with the main server.</p>
</section>
<!-- What is Git? -->
<section>
<h2>What is Git?</h2>
<p> </p>
<p><strong class="blue">Git:</strong> Free, open source version control system</p>
<ul>
<li>Distributed version control system, most widely used</li>
<li>Command line application</li>
<li>Runs on your local machine</li>
</ul>
</section>
<!-- What is Git? -->
<section>
<h2>What is GitHub?</h2>
<p> </p>
<p><strong class="blue">GitHub:</strong> web-based service that interacts with Git and allows you to host and share your code for free. You can:</p>
<ul>
<li>Collaborate with others on projects</li>
<li>Share/showcase your code</li>
<li>Find code that you can use in your own projects</li>
</ul>
<ul>
</section>
<!-- Git Terminology -->
<section>
<h2>Git Terminology</h2>
<ul>
<li><strong class="blue">Repository ("Repo"):</strong> a project folder in which Git is tracking changes to files</li>
<li><strong class="blue">Working Directory:</strong> the current local copy of a Git repository you are working on (on your computer)</li>
<li><strong class="blue">Index:</strong> staging area - list of changes not yet committed</li>
<li><strong class="blue">Head:</strong> list of committed changes</li>
<li><strong class="blue">Remote Repository:</strong> a copy of a Git repository that is stored in the cloud (in our case, GitHub)</li>
</ul>
</section>
<!-- Git Concepts -->
<section>
<h2>Git workflow</h2>
<img src="img/git-workflow.png" />
</section>
<!-- Git Concepts -->
<section>
<h2>Git workflow</h2>
<ol>
<li>Create a new folder for your project & <pre class="inline">git init</pre> to make it a Git repo (or <pre class="inline">git clone</pre> an existing repo)</li>
<li>Work on your project</li>
<li><pre class="inline">git add</pre> changes to the Index (staging area) as you work</li>
<li><pre class="inline">git commit</pre> changes to the Head ("official" list of changes)</li>
<li><pre class="inline">git push</pre> changes to your remote repository</li>
</ol>
</section>
<section>
<h2>2. Setting up a new repository</h2>
</section>
<!-- Fire up your Terminal -->
<section>
<h2>Fire up your command shell</h2>
<ul>
<li><strong class="blue">Mac OS/Linux:</strong> search in Finder for Terminal</li>
<li><strong class="blue">Windows:</strong> in the Start menu or screen, search for Babun or Cygwin</li>
</ul>
<pre class="terminal"><code class="xml">
user@bash:
</code></pre>
</section>
<!-- Check to make sure that Git is installed -->
<section>
<h2>Check that Git is installed</h2>
<p> </p>
<pre class="terminal"><code class="xml">git --version</code></pre>
</section>
<!-- Configure Git for Commits -->
<section>
<h2>Configure Git</h2>
<p>In order to record changes in your commit history, Git needs to know a little about you.</p>
<p>Add your Github Username</p>
<pre class="terminal"><code class="xml">git config --global user.name "YOUR NAME"</code></pre>
<p> </p>
<p>And the email attached to your GitHub account</p>
<pre class="terminal"><code class="xml">git config --global user.email "YOUR EMAIL"</code></pre>
</section>
<!-- Creating a new repository -->
<section>
<h2>Creating a new repository</h2>
<p>1. Create new folder</p>
<pre class="terminal"><code class="xml">mkdir my-repo</code></pre>
<p>2. Switch into that folder</p>
<pre class="terminal"><code class="xml">cd my-repo</code></pre>
<p>3. Initialize the folder as a Git repo</p>
<pre class="terminal"><code class="xml">git init</code></pre>
</section>
<!-- What happened? -->
<section>
<h2>What happened?</h2>
<p>Let's check it out!</p>
<pre class="terminal"><code class="xml">ls -al</code></pre>
<p>Hey, there's a new (hidden) folder:</p>
<pre class="terminal"><code class="xml">
your-name staff 128 Jun 19 00:23 .
your-name staff 672 Jun 19 00:39 ..
your-name staff 384 Jun 19 01:04 .git
</code></pre>
<p>Let's see what's inside</p>
<pre class="terminal"><code class="xml">ls -al .git</code></pre>
<p><small class="blue">We can also look at this Finder, but you'll only see .git if hidden files are set to visible</small></p>
</section>
<!-- Making changes -->
<section>
<h2>Making changes</h2>
<p>Create a new file</p>
<pre class="terminal"><code class="xml">touch README.md</code></pre>
<p><small class="blue">Every repository should have a README file!</small></p>
</section>
<section>
<h2>3. Basic git commands: adding, committing & pushing changes</h2>
</section>
<!-- Git Status -->
<section>
<h2>Making changes</h2>
<p><pre class="inline">git status</pre>: Check to see what changes Git has noticed</p>
<pre class="terminal"><code class="xml">git status</code></pre>
</section>
<!-- Git Add -->
<section>
<h2>Making changes</h2>
<p><pre class="inline">git add</pre>: Adds files to the Index (staging area for your next commit)</p>
<p> </p>
<p>Add all changed files</p>
<pre class="terminal"><code class="xml">git add -A</code></pre>
<p>Or to add a single file</p>
<pre class="terminal"><code class="xml">git add README.md</code></pre>
</section>
<!-- Git Add -->
<section>
<h2>Making changes</h2>
<p><pre class="inline">git add</pre>-ed something you didn't intend to?</p>
<p><pre class="inline">git reset</pre> removes those file changes from the Index</p>
<p> </p>
<p>Remove all files (from the Index)</p>
<pre class="terminal"><code class="xml">git reset</code></pre>
<p>Remove a single file (from the Index)</p>
<pre class="terminal"><code class="xml">git reset README.md</code></pre>
</section>
<!-- Git Commit -->
<section>
<h2>Making changes</h2>
<p><pre class="inline">git commit</pre>: Commits your changes to the Head</p>
<ul>
<li>A commit marks a "snapshot" in your project that you can refer/revert back to</li>
<li>Every commit requires a "commit message" - a note about the purpose of the change</li>
</ul>
<p> </p>
<pre class="terminal"><code class="xml">git commit -m "Update README file"</code></pre>
</section>
<!-- Git Log -->
<section>
<h2>Making changes</h2>
<p><pre class="inline">git log</pre>: Shows list of commits</p>
<p> </p>
<pre class="terminal"><code class="xml">git log
commit 0ac0ce458f65958fd6 (HEAD -> master)
Author: Shayna Cummings
Date: Tue Jun 19 01:14:20 2018 -0400 Add README file
</code></pre>
</section>
<!-- Practice! -->
<section>
<h2>Practice</h2>
<ol>
<li>Add some text to your README.md file (using TextEdit, Notepad, or another text editor) and save</li>
<li>Check to see what changes Git noticed</li>
<li>Add and commit the changes</li>
<li>Check your commit history</li>
</ol>
</section>
<!-- Reverting changes -->
<section>
<h2>Reverting changes</h2>
<p><pre class="inline">git reset [commit]</pre>: undoes all commits after [commit] (but keeps all commits in log history)</p>
<pre class="terminal"><code class="xml">git reset 579e546a022fe0e1297d80ebefa4c</code></pre>
<p> </p>
<p><pre class="inline">--hard</pre> option discards log history</p>
<pre class="terminal"><code class="xml">git reset --hard 579e546a022fe0e1297d80ebefa4c</code></pre>
</section>
<!-- Practice! -->
<section>
<h2>Practice</h2>
<ol>
<li>Find the commit hash for your first commit</li>
<li>Revert back to that first commit</li>
</ol>
</section>
<!-- Ignoring files -->
<section>
<h2>Ignoring files</h2>
<p>In every repo, there are likely some files that you don't want Git to track, including:</p>
<ul>
<li>System-generated files (ex: logs)</li>
<li>Files with sensitive info (ex: passwords)</li>
</ul>
<p> </p>
<p>You can tell Git to ignore any changes to these files by listing them in a <span class="blue">.gitignore</span> file. Templates for many languages are available at <a href="https://github.com/github/gitignore" target="_blank">github.com/github/gitignore</a></p>
</section>
<!-- Ignoring files -->
<section>
<h2>Ignoring files</h2>
<p>Create a .gitignore file inside your repo</p>
<pre class="terminal"><code class="xml">cd my-repo<br>vim .gitignore</code></pre>
<p>Add paths for files you want Git to ignore</p>
<pre class="terminal"><code class="xml">.DS_Store<br>*.log<br>~<br>~<br>--INSERT--</code></pre>
</section>
<!-- Practice! -->
<section>
<h2>Practice</h2>
<ol>
<li>Create a .gitignore file inside your repo that ignores .DS_Store files</li>
<li>Add and commit your changes</li>
</ol>
</section>
<section>
<h2>4. Setting up a remote repository, branching & merging</h2>
</section>
<!-- Remote Repositories -->
<section>
<h2>Remote Repositories</h2>
<p>Why use a remote repository?</p>
<ul>
<li>Back up your code</li>
<li>Showcase your work</li>
<li>Share/collaborate with others</li>
</ul>
</section>
<!-- Create a new GitHub repository -->
<section>
<h2>Create a new GitHub repository</h2>
<ol>
<li>Sign into GitHub: <a href="https://github.com/login" target="_blank">https://github.com/login</a></li>
<li><img src="img/new-repo.png" width='200' style="float: right; margin: 0 0 0 .5em; padding: 0;">Click + in the upper right and choose "New Repository"
</li>
<li>Fill out the form and click Create Repository (see example on next slide)</li>
</ol>
</section>
<section>
<img src="img/create-repo.png" width='600'>
</section>
<!-- Connect the your local repo to GitHub -->
<section>
<h2>Connect your local repo to your GitHub repo</h2>
<p>Find the URL for your new GitHub repo</p>
<img src="img/github-url.png">
</section>
<!-- Connect the your local repo to GitHub -->
<section>
<h2>Connect your local repo to your GitHub repo</h2>
<pre class="terminal"><code class="xml">git remote add origin https://github.com/...</code></pre>
<p> </p>
<p>Verify that the remote repo was added</p>
<pre class="terminal"><code class="xml">git remote -v</code></pre>
</section>
<!-- Push your commit to GitHub -->
<section>
<h2>Push code to GitHub</h2>
<p><pre class="inline">git push [remote name] [branch name]</pre><br>push most recent commit to remote repo</p>
<p> </p>
<pre class="terminal"><code class="xml">git push -u origin master</code></pre>
</section>
<!-- Practice! -->
<section>
<h2>Practice</h2>
<ol>
<li>Add some text to your README.txt file and save</li>
<li>Add and commit the change</li>
<li>Push the change to GitHub</li>
</ol>
</section>
<!-- Playing nicely with others -->
<section>
<h2>Playing nicely with others</h2>
<p>Git & GitHub allow users to work collaboratively on the same project through:</p>
<ul>
<li><span class="blue">Branching:</span> Developing features in isolated copies of a repo</li>
<li><span class="blue">Merging:</span> Incoporating branches into the master</li>
</ul>
</section>
<!-- Creating local branches -->
<section>
<h2>Creating local branches</h2>
<p>See what branch you're currently on</p>
<pre class="terminal"><code class="xml">git branch</code></pre>
<p> </p>
<p><pre class="inline">git checkout -b [branchname]</pre>: creates new branch</p>
<pre class="terminal"><code class="xml">git checkout -b add-widgets</code></pre>
<p>Use a descriptive branch name, so you'll remember what you did on it.</p>
</section>
<!-- Creating remote branches -->
<section>
<h2>Creating remote branches</h2>
<p><pre class="inline">git push [remote] [branchname]</pre>:<br />Creates a remote copy of your new local branch and pushes changes to the remote branch</p>
<pre class="terminal"><code class="xml">git push origin add-widgets</code></pre>
</section>
<!-- Practice -->
<section>
<h2>Practice</h2>
<ol>
<li>In your repo, create a new local branch named <code>[first name][last initial]</code>, for example: <code>shaynac</code></li>
<li>Create a new text file inside the repo named <code>[first name][last initial].txt</code>, for example: <code>shaynac.txt</code></li>
<li>Commit your change</li>
<li>Push your branch to the remote repository</li>
</ol>
</section>
<section>
<h2>5. Remote collaboration</h2>
</section>
<!-- Playing nicely with others -->
<section>
<h2>Branching workflow</h2>
<img src="img/branch-flow.png">
</section>
<!-- Clone an existing repository -->
<section>
<h2>Clone a remote repository</h2>
<br/>
<p><pre class="inline">git clone [URL]</pre>
<br>Make a copy of an existing repository on your local computer</p>
<pre class="terminal"><code class="xml">git clone https://github.com/gdiboston/gdi-intro-github-students</code></pre>
<p> </p>
<p><pre style="font-size: .8em;">https://github.com/gdiboston/gdi-intro-github-students</pre></p>
</section>
<!-- Fork an existing repository -->
<section>
<h2>Or fork a repository to suggest changes</h2>
<p>Click the 'Fork' button to make a copy of someone else's repo on your own Github account, and then use 'git clone' to clone your copy to your local computer</p>
<br/>
<p><pre class="inline">git clone [URL]</pre>
<pre class="terminal"><code class="xml">git clone https://github.com/YOURUSERNAME/gdi-intro-github-students</code></pre>
<p> </p>
</section>
<!-- Pull requests -->
<section>
<h2>Pull requests</h2>
<p><span class="blue">Pull requests (PRs)</span> send a message to the owner(s) of the repo asking to merge your branch with your changes into the master branch</p>
<ul>
<li>PRs are specific to GitHub (not part of Git) - sometimes referred to as 'diffs' in other systems</li>
<li>PRs can only be made via the GitHub UI</li>
</ul>
</section>
<!-- Pull requests -->
<section>
<h2>Create a pull request</h2>
<p>Switch to your branch and click 'new pull request'</p>
<img src="img/switch-branch.png" />
</section>
<section>
<h2>Comparing branches on Github</h2>
<p>You can open a PR from your branch -> master within one repository</p>
<p>OR</p>
<p>from your branch in a forked version of a repo -> the original repository</p>
<img src="img/open-pr.png" />
</section>
<!-- Merging -->
<section>
<h2>Merge a pull request</h2>
<p>If there are no conflicts, a pull request can be merged with one click</p>
<img src="img/merge-pull.png">
<p><small class="blue">Depending on the repo settings, you may be able to merge your own pull requests... this is not always a good idea</small></p>
</section>
<!-- Syncing your local repo -->
<section>
<h2>Syncing local & remote repos</h2>
<p>After pull requests are merged, it's important you sync up your local repo!</p><br />
<p><pre class="inline">git pull [remote]</pre>:<br>Gets the updates ("pull down changes") from the remote version of the current branch and merges them with your local copy</p>
<pre class="terminal"><code class="xml">git checkout master<br>git pull origin</code></pre>
</section>
<!-- Practice -->
<section>
<h2>Practice</h2>
<ol>
<li>Make a pull request</li>
<li>Wait for all class pull requests to be merged</li>
<li>Sync your local master with the remote master</li>
</ol>
</section>
<section>
<h2>6. Debugging and resolving merge conflicts</h2>
</section>
<!-- Merge conflicts -->
<section>
<h2>Merge conflicts</h2>
<p><span class="blue">Merge conflicts</span> occur when changes in your branch conflict with changes made to the remote master.<br>
<p>This can happen when:</p>
<ul>
<li>You're working on the same file as another user, and their changes get merged first</li>
<li>You haven't synced your local master with the remote master in a while</li>
</ul>
</section>
<!-- Resolve a merge conflict -->
<section>
<h2>Resolve a merge conflict</h2>
<p>1. Sync your local master with the remote master</p>
<pre class="terminal"><code class="xml">git checkout master<br>git pull</code></pre>
<p>2. Attempt to merge your local master into your local working branch (Git will tell you there's a conflict)</p>
<pre class="terminal"><code class="xml">git checkout problem-branch<br>git merge master</code></pre>
</section>
<!-- Resolve a merge conflict -->
<section>
<h2>Resolve a merge conflict</h2>
<p>3. Edit the problem file(s) in your local branch to remove the conflict(s) with the master branch. Git will mark conflicts in your files using <<< and >>></p>
<pre class="terminal" style=" padding: .8em;">
<<<<<< HEAD
Here's the line in your branch
======
Here's the same line in the master
>>>>>> master
</pre>
</section>
<!-- Resolve a merge conflict -->
<section>
<h2>Resolve a merge conflict</h2>
<p>4. Commit your changes</p>
<pre class="terminal"><code class="xml">git add [files]<br>git commit -m "resolve merge conflict"</code></pre>
<p>5. Push your changes to the remote branch</p>
<pre class="terminal"><code class="xml">git push origin problem-branch</code></pre>
<p class="blue"><small>No need to open a new Pull Request - your pushed changes will automatically be reflected in the current Pull Request</small></p>
</section>
<!-- Resources -->
<section>
<h2>Resources</h2>
<ul>
<li><a href="http://rogerdudler.github.io/git-guide/" target="_blank">Git - the simple guide</a></li>
<li><a href="https://help.github.com/" target="_blank">GitHub Help</a></li>
<li><a href="https://help.github.com/articles/set-up-git/" target="_blank">How to set up Git</a></li>
<li><a href="https://git-scm.com/doc" target="_blank">Git Documentation</a></li>
<li><a href="https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf" target="_blank">Git Cheat Sheet</a></li>
<li><a href="https://blog.github.com/2015-06-08-how-to-undo-almost-anything-with-git/" target="_blank">How to undo anything with Git</a></li>
</ul>
</section>
<!-- Thanks! -->
<section>
<p> </p>
<h2>Thanks!</h2>
<p> </p>
<p class="blue">Questions?</p>
<p>boston@girldevelopit.com</p>
</section>
</div>
<footer>
<div class="copyright">
Intro to Version Control with Git/GitHub - GDI Boston Chapter
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" /></a>
</div>
</footer>
</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,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/none
// Optional libraries used to extend on reveal.js
dependencies: [{
src: 'lib/js/classList.js',
condition: function() {
return !document.body.classList;
}
}, {
src: 'plugin/markdown/showdown.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>