Skip to content

Commit

Permalink
Merge pull request #1 from esciencecenter-digital-skills/git-and-good…
Browse files Browse the repository at this point in the history
…-practices

Git and good practices
  • Loading branch information
JaroCamphuijsen authored Jul 30, 2024
2 parents ca3dd55 + 168dcd2 commit 9fa36b8
Show file tree
Hide file tree
Showing 204 changed files with 86,370 additions and 142 deletions.
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"publicProps": {
"title": "Add a title for your lesson/project",
"title": "Digital Skills Slides",
"baseURL": "digital-skills-slides",
"repoName": "digital-skills-slides",
"repoOwner": "esciencecenter-digital-skills",
"organization": "Netherlands eScience Center",
"categoryOrder": ["Category1", "Category2"]
"categoryOrder": ["Good Practices"]
}
}
162 changes: 162 additions & 0 deletions modules/git-lesson/git-slides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
---
title: Git and GitHub
type: slides
order: 1
---

<!-- .slide: data-state="title" -->

# Automated Version Control

What is version control and why should I use it?

Note:
- Git all set up?
- SSH working?
- Otherwise: breakout room

===

<!-- .slide: data-state="standard" -->
<img style="height: 70vh;" src="https://swcarpentry.github.io/git-novice/fig/phd101212s.png"/>

<span style="font-size: small;">“Piled Higher and Deeper” by Jorge Cham, http://www.phdcomics.com </span>

===

<!-- .slide: data-state="standard" -->
## Documents are...
<div class="fragment">
a series of changes
<img style="height: 30vh; margin: 0; padding: 0;" src="https://swcarpentry.github.io/git-novice/fig/play-changes.svg"/>
</div>

===

<!-- .slide: data-state="standard" -->
## Collaboration
<div style="float: left; width: 49%;">
independent changes
<img style="height: 350px;" src="./media/versions.svg"/>
</div>
<div class="fragment" style="float: right; width: 49%;">
can be merged
<img style="height: 350px;" src="./media/merge.svg"/>
</div>

===

<!-- .slide: data-state="standard" -->
## Version Control: Key Points

- Version control is track changes on steroids.
- Version control is like an unlimited **undo**.
- Version control also allows many people to work in parallel.

===

<!-- .slide: data-state="standard" -->
## The Holy Realms of Git

<img src="https://swcarpentry.github.io/git-novice/fig/git-staging-area.svg">

<ul>
<li><b>workspace</b>&nbsp;&nbsp;📂</li>
<ul>
<li>Your filesystem</li>
</ul>
<li class="fragment"><b>index</b>&nbsp;&nbsp;🕒
<ul>
<li>Staging area</li>
<li>Files wait patiently to be committed</li>
</ul>
</li>
<li class="fragment"><b>local repository</b>&nbsp;&nbsp;🗂️
<ul>
<li>Contains branches, commits, history, etc.</li>
</ul>
</li>
<ul>

===

<!-- .slide: data-state="standard" -->
## Crowded Staging Area / Index

<img src="https://swcarpentry.github.io/git-novice/fig/git-committing.svg">

The Staging Area / Index can hold many files and folders.

===

<!-- .slide: data-state="standard" -->
## Quiz 1/2

<blockquote style="text-align: left;">
Which commit message should I choose?
<ol>
<li>“Changes”</li>
<li>“Added line ‘This project started as a joke’ to myfile.txt”</li>
<li>“Discuss origin of the project”</li>
</ol>
</code></pre>
</blockquote>
<blockquote class="fragment" style="text-align: right;">
Make it short, descriptive, and imperative <span style="font-style: normal;">🐺</span>
</blockquote>
<blockquote class="fragment" style="text-align: right;">
So yeah, the last one is good! <span style="font-style: normal;">🐺</span>
</blockquote>

===

<!-- .slide: data-state="standard" -->
## Quiz 2/2

<blockquote style="text-align: left;">
Which command saves <b>myfile.txt</b> to my Git repo?<br>
<ol>
<li>
<pre style="width: 100%; font-style: normal;" data-id="code-animation"><code data-trim class="bash">
$ git commit -m "my recent changes"
</code></pre>
</li>
<li>
<pre style="width: 100%; font-style: normal;" data-id="code-animation"><code data-trim class="bash">
$ git init myfile.txt
$ git commit -m "my recent changes"
</code></pre>
</li>
<li>
<pre style="width: 100%; font-style: normal;" data-id="code-animation"><code data-trim class="bash">
$ git add myfile.txt
$ git commit -m "my recent changes"
</code></pre>
</li>
<li>
<pre style="width: 100%; font-style: normal;" data-id="code-animation"><code data-trim class="bash">
$ git commit -m myfile.txt "my recent changes"
</code></pre>
</li>
</ol>
</code></pre>
</blockquote>
<blockquote class="fragment" style="text-align: right;">
3. adds your file to the index, and then commits it. That's the one.
<span style="font-style: normal;">🐺</span>
</blockquote>


===

<!-- .slide: data-state="standard" -->
## Tracking Changes: Key Points

- Files can be stored in
- **working directory**: the files you can see
- **staging area / index**: files about to be committed
- **local repository**: the permanent record
- **git status**&nbsp; shows the status of a repository
- **git add**&nbsp; puts files in the staging area
- **git commit**&nbsp; saves the staged content as a new commit in the local repository
- Write short, descriptive, and imperative commit messages
11 changes: 11 additions & 0 deletions modules/git-lesson/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
id: 0
category: Good Practices
title: Version control with Git and GitHub
author: eScience Center
thumbnail: "version-control-thumbnail.jpg"
visibility: visible
---

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>

13 changes: 13 additions & 0 deletions modules/git-lesson/info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Info
type: info
order: 0
---

## Collaborative version control with Git and GitHub
This workshop introduces version control with Git and teaches you how to collaborate using Git and GitHub.

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.

## The content
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).
23 changes: 23 additions & 0 deletions modules/git-lesson/media/TUSAIL_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/git-lesson/media/boy-g17e8683be_1920.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions modules/git-lesson/media/cut_e.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/git-lesson/media/desk-593327_1920.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions modules/git-lesson/media/e-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/git-lesson/media/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions modules/git-lesson/media/letter-e.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9fa36b8

Please sign in to comment.