Skip to content

Commit 9fa36b8

Browse files
Merge pull request #1 from esciencecenter-digital-skills/git-and-good-practices
Git and good practices
2 parents ca3dd55 + 168dcd2 commit 9fa36b8

File tree

204 files changed

+86370
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+86370
-142
lines changed

config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"publicProps": {
3-
"title": "Add a title for your lesson/project",
3+
"title": "Digital Skills Slides",
44
"baseURL": "digital-skills-slides",
55
"repoName": "digital-skills-slides",
66
"repoOwner": "esciencecenter-digital-skills",
77
"organization": "Netherlands eScience Center",
8-
"categoryOrder": ["Category1", "Category2"]
8+
"categoryOrder": ["Good Practices"]
99
}
1010
}

modules/git-lesson/git-slides.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
---
2+
title: Git and GitHub
3+
type: slides
4+
order: 1
5+
---
6+
7+
<!-- .slide: data-state="title" -->
8+
9+
# Automated Version Control
10+
11+
What is version control and why should I use it?
12+
13+
Note:
14+
- Git all set up?
15+
- SSH working?
16+
- Otherwise: breakout room
17+
18+
===
19+
20+
<!-- .slide: data-state="standard" -->
21+
<img style="height: 70vh;" src="https://swcarpentry.github.io/git-novice/fig/phd101212s.png"/>
22+
23+
<span style="font-size: small;">“Piled Higher and Deeper” by Jorge Cham, http://www.phdcomics.com </span>
24+
25+
===
26+
27+
<!-- .slide: data-state="standard" -->
28+
## Documents are...
29+
<div class="fragment">
30+
a series of changes
31+
<img style="height: 30vh; margin: 0; padding: 0;" src="https://swcarpentry.github.io/git-novice/fig/play-changes.svg"/>
32+
</div>
33+
34+
===
35+
36+
<!-- .slide: data-state="standard" -->
37+
## Collaboration
38+
<div style="float: left; width: 49%;">
39+
independent changes
40+
<img style="height: 350px;" src="./media/versions.svg"/>
41+
</div>
42+
<div class="fragment" style="float: right; width: 49%;">
43+
can be merged
44+
<img style="height: 350px;" src="./media/merge.svg"/>
45+
</div>
46+
47+
===
48+
49+
<!-- .slide: data-state="standard" -->
50+
## Version Control: Key Points
51+
52+
- Version control is track changes on steroids.
53+
- Version control is like an unlimited **undo**.
54+
- Version control also allows many people to work in parallel.
55+
56+
===
57+
58+
<!-- .slide: data-state="standard" -->
59+
## The Holy Realms of Git
60+
61+
<img src="https://swcarpentry.github.io/git-novice/fig/git-staging-area.svg">
62+
63+
<ul>
64+
<li><b>workspace</b>&nbsp;&nbsp;📂</li>
65+
<ul>
66+
<li>Your filesystem</li>
67+
</ul>
68+
<li class="fragment"><b>index</b>&nbsp;&nbsp;🕒
69+
<ul>
70+
<li>Staging area</li>
71+
<li>Files wait patiently to be committed</li>
72+
</ul>
73+
</li>
74+
<li class="fragment"><b>local repository</b>&nbsp;&nbsp;🗂️
75+
<ul>
76+
<li>Contains branches, commits, history, etc.</li>
77+
</ul>
78+
</li>
79+
<ul>
80+
81+
===
82+
83+
<!-- .slide: data-state="standard" -->
84+
## Crowded Staging Area / Index
85+
86+
<img src="https://swcarpentry.github.io/git-novice/fig/git-committing.svg">
87+
88+
The Staging Area / Index can hold many files and folders.
89+
90+
===
91+
92+
<!-- .slide: data-state="standard" -->
93+
## Quiz 1/2
94+
95+
<blockquote style="text-align: left;">
96+
Which commit message should I choose?
97+
<ol>
98+
<li>“Changes”</li>
99+
<li>“Added line ‘This project started as a joke’ to myfile.txt”</li>
100+
<li>“Discuss origin of the project”</li>
101+
</ol>
102+
</code></pre>
103+
</blockquote>
104+
<blockquote class="fragment" style="text-align: right;">
105+
Make it short, descriptive, and imperative <span style="font-style: normal;">🐺</span>
106+
</blockquote>
107+
<blockquote class="fragment" style="text-align: right;">
108+
So yeah, the last one is good! <span style="font-style: normal;">🐺</span>
109+
</blockquote>
110+
111+
===
112+
113+
<!-- .slide: data-state="standard" -->
114+
## Quiz 2/2
115+
116+
<blockquote style="text-align: left;">
117+
Which command saves <b>myfile.txt</b> to my Git repo?<br>
118+
<ol>
119+
<li>
120+
<pre style="width: 100%; font-style: normal;" data-id="code-animation"><code data-trim class="bash">
121+
$ git commit -m "my recent changes"
122+
</code></pre>
123+
</li>
124+
<li>
125+
<pre style="width: 100%; font-style: normal;" data-id="code-animation"><code data-trim class="bash">
126+
$ git init myfile.txt
127+
$ git commit -m "my recent changes"
128+
</code></pre>
129+
</li>
130+
<li>
131+
<pre style="width: 100%; font-style: normal;" data-id="code-animation"><code data-trim class="bash">
132+
$ git add myfile.txt
133+
$ git commit -m "my recent changes"
134+
</code></pre>
135+
</li>
136+
<li>
137+
<pre style="width: 100%; font-style: normal;" data-id="code-animation"><code data-trim class="bash">
138+
$ git commit -m myfile.txt "my recent changes"
139+
</code></pre>
140+
</li>
141+
</ol>
142+
</code></pre>
143+
</blockquote>
144+
<blockquote class="fragment" style="text-align: right;">
145+
3. adds your file to the index, and then commits it. That's the one.
146+
<span style="font-style: normal;">🐺</span>
147+
</blockquote>
148+
149+
150+
===
151+
152+
<!-- .slide: data-state="standard" -->
153+
## Tracking Changes: Key Points
154+
155+
- Files can be stored in
156+
- **working directory**: the files you can see
157+
- **staging area / index**: files about to be committed
158+
- **local repository**: the permanent record
159+
- **git status**&nbsp; shows the status of a repository
160+
- **git add**&nbsp; puts files in the staging area
161+
- **git commit**&nbsp; saves the staged content as a new commit in the local repository
162+
- Write short, descriptive, and imperative commit messages

modules/git-lesson/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
id: 0
3+
category: Good Practices
4+
title: Version control with Git and GitHub
5+
author: eScience Center
6+
thumbnail: "version-control-thumbnail.jpg"
7+
visibility: visible
8+
---
9+
10+
Photo by <a href="https://unsplash.com/@wesleyphotography?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Wesley Tingey</a> on <a href="https://unsplash.com/photos/stack-of-books-on-table-snNHKZ-mGfE?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>
11+

modules/git-lesson/info.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Info
3+
type: info
4+
order: 0
5+
---
6+
7+
## Collaborative version control with Git and GitHub
8+
This workshop introduces version control with Git and teaches you how to collaborate using Git and GitHub.
9+
10+
Knowing how to use Git and GitHub will allow you to keep track of changes in your software project, publish your code online, collaborate with several people in the same project, and contribute to projects as an external collaborator.
11+
12+
## The content
13+
This website hosts only the slides for the workshop. For the lesson content and exercises, see this [workbench lesson](https://esciencecenter-digital-skills.github.io/git-lesson/) or associated [GitHub repository](https://github.com/esciencecenter-digital-skills/git-lesson).
Lines changed: 23 additions & 0 deletions
Loading
Loading
Loading
Loading

modules/git-lesson/media/cut_e.svg

Lines changed: 89 additions & 0 deletions
Loading
297 KB
Loading

modules/git-lesson/media/e-logo.svg

Lines changed: 32 additions & 0 deletions
Loading
928 Bytes
Loading
Loading
Loading
Loading
Loading

modules/git-lesson/media/letter-e.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)