Add lesson 2: Your first commit

Mira Kovac 1 year ago
parent 9c89d90117 commit aede4e2ed607b110559d8b4b15c53128322d3402
3 changed files with 30 additions and 0 deletions
+19-0lessons/02-your-first-commit/README.md ADDED
@@ -0,0 +1,19 @@
1+# Lesson 2: Your first commit
2+
3+This lesson covers your first commit. You'll read a short explanation, try three small exercises and finish with a quiz.
4+
5+Full lesson: [https://glibcode.net/courses/git-github/lessons/2](https://glibcode.net/courses/git-github/lessons/2)
6+
7+## Files
8+
9+- `commands.sh`: init, add and commit
10+
11+## Run it
12+
13+```sh
14+# type the commands from commands.sh one by one; don't run it as a script
15+```
16+
17+## Exercises
18+
19+See [exercises.md](exercises.md). Ask in the forum once you've tried.
+6-0lessons/02-your-first-commit/commands.sh ADDED
@@ -0,0 +1,6 @@
1+git init my-project
2+cd my-project
3+echo "# My project" > README.md
4+git add README.md
5+git commit -m "Start the project"
6+git log --oneline
+5-0lessons/02-your-first-commit/exercises.md ADDED
@@ -0,0 +1,5 @@
1+# Exercises: lesson 2
2+
3+1. Rewrite the main part so it runs twice with two different inputs, without copying the code.
4+2. Run `commands.sh` and change one value. Write down what you expect, then run it again and compare.
5+3. Add a comment above each block explaining what it does, in your own words.