Skip to content

Commit 2b02ae2

Browse files
committed
beta branch page
1 parent e2a0cbb commit 2b02ae2

File tree

7 files changed

+206
-28
lines changed

7 files changed

+206
-28
lines changed

docs/handson_branch.html

Lines changed: 126 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,49 @@
3030
<script src="site_libs/font-awesome-5.0.13/js/fa-v4-shims.min.js"></script>
3131

3232

33+
<style type="text/css">code{white-space: pre;}</style>
34+
<style type="text/css">
35+
div.sourceCode { overflow-x: auto; }
36+
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
37+
margin: 0; padding: 0; vertical-align: baseline; border: none; }
38+
table.sourceCode { width: 100%; line-height: 100%; background-color: #f8f8f8; }
39+
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
40+
td.sourceCode { padding-left: 5px; }
41+
pre, code { background-color: #f8f8f8; }
42+
code > span.kw { color: #204a87; font-weight: bold; } /* Keyword */
43+
code > span.dt { color: #204a87; } /* DataType */
44+
code > span.dv { color: #0000cf; } /* DecVal */
45+
code > span.bn { color: #0000cf; } /* BaseN */
46+
code > span.fl { color: #0000cf; } /* Float */
47+
code > span.ch { color: #4e9a06; } /* Char */
48+
code > span.st { color: #4e9a06; } /* String */
49+
code > span.co { color: #8f5902; font-style: italic; } /* Comment */
50+
code > span.ot { color: #8f5902; } /* Other */
51+
code > span.al { color: #ef2929; } /* Alert */
52+
code > span.fu { color: #000000; } /* Function */
53+
code > span.er { color: #a40000; font-weight: bold; } /* Error */
54+
code > span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */
55+
code > span.cn { color: #000000; } /* Constant */
56+
code > span.sc { color: #000000; } /* SpecialChar */
57+
code > span.vs { color: #4e9a06; } /* VerbatimString */
58+
code > span.ss { color: #4e9a06; } /* SpecialString */
59+
code > span.im { } /* Import */
60+
code > span.va { color: #000000; } /* Variable */
61+
code > span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
62+
code > span.op { color: #ce5c00; font-weight: bold; } /* Operator */
63+
code > span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
64+
code > span.ex { } /* Extension */
65+
code > span.at { color: #c4a000; } /* Attribute */
66+
code > span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
67+
code > span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
68+
code > span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
69+
code > span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
70+
</style>
71+
<style type="text/css">
72+
pre:not([class]) {
73+
background-color: white;
74+
}
75+
</style>
3376

3477

3578
<style type="text/css">
@@ -323,21 +366,91 @@ <h1 class="title toc-ignore">Git: Branch / Merge / Revert</h1>
323366
</div>
324367

325368

369+
<p>This document follows set-up from the <a href="handson.html">previous document</a></p>
370+
<div id="standard-edit" class="section level2">
371+
<h2>Standard Edit</h2>
372+
<ul>
373+
<li>Add your name and a bulleted list with three of your favorite foods</li>
374+
<li>Commit your changes</li>
375+
</ul>
376+
</div>
377+
<div id="branch" class="section level2">
378+
<h2>Branch</h2>
326379
<ol style="list-style-type: decimal">
327-
<li>Make Branch “version2”
328-
<ol style="list-style-type: decimal">
329-
<li>checkout version2</li>
330-
<li>Add stuff (todo.md)</li>
331-
</ol></li>
332-
<li>Checkout Main Branch
333-
<ol style="list-style-type: decimal">
334-
<li>update README.Rmd</li>
335-
<li>Look at the various tracks</li>
336-
</ol></li>
337-
<li>Merge.</li>
338-
<li>Conflict</li>
339-
<li>Revert</li>
380+
<li><p>Create a branch <em>version2</em></p>
381+
<ul>
382+
<li>The funny icon is used to <strong>create</strong> and <strong>checkout</strong> a branch</li>
383+
<li>By clicking <strong>Create</strong>, <code>git checkout &lt;&lt;branch-name&gt;&gt;</code> is invoked</li>
384+
<li>Create a new text that lists 3 favorite movies save it as <code>movies.md</code></li>
385+
<li>Commit your changes</li>
386+
</ul></li>
387+
</ol>
388+
<p><img src="images/branch_create.png" style="display: block; margin: auto;" /></p>
389+
<ol start="2" style="list-style-type: decimal">
390+
<li><p>Checkout the <em>master</em> branch</p>
391+
<ul>
392+
<li>Watch the <strong>Files</strong> tab as you switch back to the <em>master</em> branch. Where is the <code>movies.md</code> file?</li>
393+
</ul></li>
394+
</ol>
395+
<p><img src="images/branch_checkout.png" style="display: block; margin: auto;" /></p>
396+
<ol start="3" style="list-style-type: decimal">
397+
<li><p>Checkout the <em>version2</em> branch again</p>
398+
<ul>
399+
<li>Edit the README.md file by adding 3 of your favorite books</li>
400+
<li>Commit your changes</li>
401+
<li>Push your changes</li>
402+
</ul></li>
403+
<li><p>Observe the visual representations of the branching and updating. &lt;<Git - Clock>&gt; -OR- GitHub &gt; Settings &gt; Insights &gt; Network</p></li>
340404
</ol>
405+
</div>
406+
<div id="merge" class="section level2">
407+
<h2>Merge</h2>
408+
<ol start="5" style="list-style-type: decimal">
409+
<li><p>Checkout the <em>master</em> branch</p>
410+
<ul>
411+
<li>In the Terminal window type: <code>git merge version2</code></li>
412+
<li>You should see a terminal response similar to below…</li>
413+
<li>Then, Push your changes</li>
414+
</ul></li>
415+
</ol>
416+
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">Updating</span> 83fb5bb..08c9267
417+
<span class="ex">Fast-forward</span>
418+
<span class="ex">README.md</span> <span class="kw">|</span> <span class="ex">8</span> +++++++-
419+
<span class="ex">movies.md</span> <span class="kw">|</span> <span class="ex">5</span> +++++
420+
<span class="ex">2</span> files changed, 12 insertions(+), <span class="ex">1</span> deletion(-)
421+
<span class="ex">create</span> mode 100644 movies.md</code></pre></div>
422+
<ol start="6" style="list-style-type: decimal">
423+
<li>Observe the visual representations of the version history</li>
424+
</ol>
425+
</div>
426+
<div id="conflict" class="section level2">
427+
<h2>Conflict</h2>
428+
<ol start="7" style="list-style-type: decimal">
429+
<li>Edit README.md in <em>master</em> by changing your name. Commit then Push.</li>
430+
<li>Edit README.md in <em>version2</em> by changing the name to something different from the step above. Commit then Push.</li>
431+
<li>Checkout <em>master</em>, then <code>git merge version2</code></li>
432+
<li>Fix Conflicts, then Save. ; Commit and Push.</li>
433+
</ol>
434+
</div>
435+
<div id="revert" class="section level2">
436+
<h2>Revert</h2>
437+
<ol start="11" style="list-style-type: decimal">
438+
<li>Checkout <em>master</em></li>
439+
<li>Create New text file, <code>colors.md</code> and list three of your favorite colors</li>
440+
<li>Commit and Push</li>
441+
<li>Add a fourth color to <code>colors.md</code> ; Commit and Push</li>
442+
<li>Observe the visual representations of the version history</li>
443+
<li>Now <em>revert</em> the last change because you changed your mind and you don’t have four favorite colors. In the terminal window type…</li>
444+
</ol>
445+
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="fu">git</span> revert HEAD</code></pre></div>
446+
<ul>
447+
<li><code>:wq</code></li>
448+
</ul>
449+
<ol start="17" style="list-style-type: decimal">
450+
<li>Commit and Push.</li>
451+
<li>Observe the visual representations of the version history</li>
452+
</ol>
453+
</div>
341454

342455
&nbsp;
343456

docs/images/branch_checkout.png

7.24 KB
Loading

docs/images/branch_create.png

15.8 KB
Loading

handson.Rmd

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ output:
55
self_contained: false
66
---
77

8-
```{r, message=FALSE, warning=FALSE, include=FALSE}
9-
library(tidyverse)
10-
```
11-
128
### Generate SSH Keys
139

1410
This step was covered in the [Outline Section](outline.html#generate_ssh_keys_in_advance_of_the_workshop). This must be done on each workstation you use to *push*.

handson_branch.Rmd

Lines changed: 80 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,86 @@ output:
55
self_contained: false
66
---
77

8-
```{r, message=FALSE, warning=FALSE, include=FALSE}
9-
library(tidyverse)
8+
This document follows set-up from the [previous document](handson.html)
9+
10+
## Standard Edit
11+
12+
- Add your name and a bulleted list with three of your favorite foods
13+
- Commit your changes
14+
15+
## Branch
16+
1. Create a branch *version2*
17+
18+
- The funny icon is used to **create** and **checkout** a branch
19+
- By clicking **Create**, `git checkout <<branch-name>>` is invoked
20+
- Create a new text that lists 3 favorite movies save it as `movies.md`
21+
- Commit your changes
22+
23+
```{r echo=FALSE, fig.align='center'}
24+
knitr::include_graphics('images/branch_create.png')
1025
```
26+
27+
2. Checkout the *master* branch
28+
29+
- Watch the **Files** tab as you switch back to the *master* branch. Where is the `movies.md` file?
30+
31+
```{r echo=FALSE, fig.align='center'}
32+
knitr::include_graphics('images/branch_checkout.png')
33+
```
34+
35+
3. Checkout the *version2* branch again
36+
37+
- Edit the README.md file by adding 3 of your favorite books
38+
- Commit your changes
39+
- Push your changes
40+
41+
4. Observe the visual representations of the branching and updating. <<Git - Clock>> -OR- GitHub > Settings > Insights > Network
42+
43+
## Merge
44+
45+
5. Checkout the *master* branch
46+
47+
- In the Terminal window type: `git merge version2`
48+
- You should see a terminal response similar to below...
49+
- Then, Push your changes
50+
51+
``` bash
52+
Updating 83fb5bb..08c9267
53+
Fast-forward
54+
README.md | 8 +++++++-
55+
movies.md | 5 +++++
56+
2 files changed, 12 insertions(+), 1 deletion(-)
57+
create mode 100644 movies.md
58+
59+
```
60+
61+
6. Observe the visual representations of the version history
62+
63+
## Conflict
64+
65+
7. Edit README.md in *master* by changing your name. Commit then Push.
66+
8. Edit README.md in *version2* by changing the name to something different from the step above. Commit then Push.
67+
9. Checkout *master*, then `git merge version2`
68+
10. Fix Conflicts, then Save. ; Commit and Push.
69+
70+
## Revert
71+
72+
11. Checkout *master*
73+
12. Create New text file, `colors.md` and list three of your favorite colors
74+
13. Commit and Push
75+
14. Add a fourth color to `colors.md` ; Commit and Push
76+
15. Observe the visual representations of the version history
77+
16. Now *revert* the last change because you changed your mind and you don't have four favorite colors. In the terminal window type...
78+
79+
``` bash
80+
git revert HEAD
81+
```
82+
83+
- `:wq`
84+
85+
17. Commit and Push.
86+
1. Observe the visual representations of the version history
87+
88+
1189

12-
1. Make Branch "version2"
13-
1. checkout version2
14-
1. Add stuff (todo.md)
15-
1. Checkout Main Branch
16-
1. update README.Rmd
17-
1. Look at the various tracks
18-
1. Merge.
19-
1. Conflict
20-
1. Revert
2190

images/branch_checkout.png

7.24 KB
Loading

images/branch_create.png

15.8 KB
Loading

0 commit comments

Comments
 (0)