Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fun Route.aufgabenFilesLocalJekyll() {

val response =
this.getStaticContent(
"markdown-git-uebungen/" +
"markdown-git-uebungen${call.parameters["language_suffix"] ?: ""}/" +
(call.parameters.getAll("path")?.joinToString("/") ?: "")
)
// Schritt 1 - Navigation in Übungsverzeichnisse <!-- UEB/Das `git`-Kommando!/1 -->
Expand Down
1 change: 0 additions & 1 deletion generator/src/main/kotlin/impl/AbstractWorkingDir.kt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ abstract class AbstractWorkingDir<T>(

@Suppress("UNCHECKED_CAST")
fun createIntro(title: String, description: String = "", setup: T.() -> Unit = {}) {
solutionCollector.registerAufgabe(title)
markdown(("# Übung" en "# Exercise") + " - $title")
markdown(description)
supressLogging(setup)
Expand Down
1 change: 1 addition & 0 deletions generator/src/main/kotlin/impl/CollectionOfSamples.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class CollectionOfSamples(rootDir: File, options: LogBuilderOptions) :
log.nav_order.put("aufgabe-$fullName", aufgabenNamen.size)
log.nav_order.put("loesung-$fullName", aufgabenNamen.size)
aufgabenNamen.add(fullName)
solutionCollector.registerAufgabe(fullName)

createSample("loesungen/$fullName") {
inDir(".") {
Expand Down
4 changes: 2 additions & 2 deletions generator/src/main/kotlin/impl/SolutionCollector.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class SolutionCollector {
val collectedCommands: MutableList<Pair<String, () -> Unit>> = mutableListOf()
val aufgabenUndSchritte: MutableList<Pair<String, MutableList<String>>> = mutableListOf()

fun registerAufgabe(title: String) {
aufgabenUndSchritte.add(title to mutableListOf<String>())
fun registerAufgabe(id:String) {
aufgabenUndSchritte.add(id to mutableListOf<String>())
}

fun registerSchritt(schritt: String) {
Expand Down
16 changes: 8 additions & 8 deletions markdown-git-uebungen-en/aufgabe-commits-erstellen.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,56 +30,56 @@ In the `repo` directory, a Git project is waiting
to be edited.


<h2>Step 0 - START <!-- UEB/Creating Commits/0 --></h2>
<h2>Step 0 - START <!-- UEB/commits-erstellen/0 --></h2>


<pre><code>$ <b>cd repo</b><br><br><br></code></pre>


<h2>Step 1 - Commit - with Staging <!-- UEB/Creating Commits/1 --></h2>
<h2>Step 1 - Commit - with Staging <!-- UEB/commits-erstellen/1 --></h2>

Start in directory `git-uebungen/aufgaben/commits-erstellen/repo`.

Edit the file `hallo-welt`,
add it to the index with `git add` (staging)
and create a commit with these changes.

<h2>Step 2 - Commit - automatic staging <!-- UEB/Creating Commits/2 --></h2>
<h2>Step 2 - Commit - automatic staging <!-- UEB/commits-erstellen/2 --></h2>

Start in directory `git-uebungen/aufgaben/commits-erstellen/repo`.

Edit the file `hallo-welt` again
and create another commit,
but this time with `-a`.

<h2>Step 3 - Commit - new file <!-- UEB/Creating Commits/3 --></h2>
<h2>Step 3 - Commit - new file <!-- UEB/commits-erstellen/3 --></h2>

Start in directory `git-uebungen/aufgaben/commits-erstellen/repo`.

Create `new-world` and confirm it with a commit.

<h2>Step 4 - Commit - delete file <!-- UEB/Creating Commits/4 --></h2>
<h2>Step 4 - Commit - delete file <!-- UEB/commits-erstellen/4 --></h2>

Start in directory `git-uebungen/aufgaben/commits-erstellen/repo`.

Delete `hallo-welt` and confirm this with a commit.

<h2>Step 5 - ⭐ Add - recursively add files <!-- UEB/Creating Commits/5 --></h2>
<h2>Step 5 - ⭐ Add - recursively add files <!-- UEB/commits-erstellen/5 --></h2>

Start in directory `git-uebungen/aufgaben/commits-erstellen/repo`.

Create a file `superneu` and a directory `sub` with a
file `auchneu`, add both with *one* add call and then create
a commit.

<h2>Step 6 - ⭐ Commit - move/rename file <!-- UEB/Creating Commits/6 --></h2>
<h2>Step 6 - ⭐ Commit - move/rename file <!-- UEB/commits-erstellen/6 --></h2>

Start in directory `git-uebungen/aufgaben/commits-erstellen/repo`.

Rename the file `hello-world` to `renamed-world`
and confirm this with a commit.

<h2>Step 7 - ⭐ Rename detection <!-- UEB/Creating Commits/7 --></h2>
<h2>Step 7 - ⭐ Rename detection <!-- UEB/commits-erstellen/7 --></h2>

Start in directory `git-uebungen/aufgaben/commits-erstellen/repo`.

Expand Down
12 changes: 6 additions & 6 deletions markdown-git-uebungen-en/aufgabe-commits-staging.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ In the `repo` directory, a Git project is waiting
to be edited.


<h2>Step 0 - START <!-- UEB/Staging/0 --></h2>
<h2>Step 0 - START <!-- UEB/commits-staging/0 --></h2>


<pre><code>$ <b>cd repo</b><br><br><br></code></pre>


<h2>Step 1 - Staging <!-- UEB/Staging/1 --></h2>
<h2>Step 1 - Staging <!-- UEB/commits-staging/1 --></h2>

Start in directory `git-uebungen/aufgaben/commits-staging/repo`.

Expand All @@ -51,28 +51,28 @@ Then replace `doof` with `toll`.
Show the status and diffs
for the workspace and stage.

<h2>Step 2 - Restore - Staging zurücknehmen <!-- UEB/Staging/2 --></h2>
<h2>Step 2 - Restore - Staging zurücknehmen <!-- UEB/commits-staging/2 --></h2>

Start in directory `git-uebungen/aufgaben/commits-staging/repo`.

The last change should not be included in the next commit yet,
so undo it.

<h2>Step 3 - Restore - Änderung ganz zurücknehmen <!-- UEB/Staging/3 --></h2>
<h2>Step 3 - Restore - Änderung ganz zurücknehmen <!-- UEB/commits-staging/3 --></h2>

Start in directory `git-uebungen/aufgaben/commits-staging/repo`.

The changes to `demo` should be completely undone.
Show the status and diffs afterwards.

<h2>Step 4 - ⭐ Restore - Älteren Inhalt einer Datei zurückholen <!-- UEB/Staging/4 --></h2>
<h2>Step 4 - ⭐ Restore - Älteren Inhalt einer Datei zurückholen <!-- UEB/commits-staging/4 --></h2>

Start in directory `git-uebungen/aufgaben/commits-staging/repo`.

The file `beispiel` was edited three times.
Restore the middle state and create a commit.

<h2>Step 5 - ⭐ Restore - Zurückholen älterer Verzeichnisversionen <!-- UEB/Staging/5 --></h2>
<h2>Step 5 - ⭐ Restore - Zurückholen älterer Verzeichnisversionen <!-- UEB/commits-staging/5 --></h2>

Start in directory `git-uebungen/aufgaben/commits-staging/repo`.

Expand Down
20 changes: 10 additions & 10 deletions markdown-git-uebungen-en/aufgabe-intro-commandline.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ the `git` command.

[Short intro to the command line](../installation/commandline)

<h2>Step 0 - START <!-- UEB/The `git` command!/0 --></h2>
<h2>Step 0 - START <!-- UEB/intro-commandline/0 --></h2>

<h2>Step 1 - Navigation in exercise directories <!-- UEB/The `git` command!/1 --></h2>
<h2>Step 1 - Navigation in exercise directories <!-- UEB/intro-commandline/1 --></h2>

Start in directory `git-uebungen`.

Expand All @@ -62,13 +62,13 @@ Use tab completion to avoid typing so much.
Then navigate back to the parent
directory `intro-commandline`.

<h2>Step 2 - Check Git version <!-- UEB/The `git` command!/2 --></h2>
<h2>Step 2 - Check Git version <!-- UEB/intro-commandline/2 --></h2>

Start in directory `git-uebungen/aufgaben/intro-commandline`.

Print which version of Git is installed.

<h2>Step 3 - Help <!-- UEB/The `git` command!/3 --></h2>
<h2>Step 3 - Help <!-- UEB/intro-commandline/3 --></h2>

Start in directory `git-uebungen/aufgaben/intro-commandline`.

Expand All @@ -78,7 +78,7 @@ Show the help page for the `log` command.
<pre><code>$ <b>cd repo</b><br><br><br></code></pre>


<h2>Step 4 - `less` and long outputs <!-- UEB/The `git` command!/4 --></h2>
<h2>Step 4 - `less` and long outputs <!-- UEB/intro-commandline/4 --></h2>

Start in directory `git-uebungen/aufgaben/intro-commandline/repo`.

Expand All @@ -87,7 +87,7 @@ Because this does not fit in a terminal window,
the `less` viewer is opened. Close it.
Then use `less some-file.txt` to view a file in `less` mode.

<h2>Step 5 - Configure Git <!-- UEB/The `git` command!/5 --></h2>
<h2>Step 5 - Configure Git <!-- UEB/intro-commandline/5 --></h2>

Start in directory `git-uebungen/aufgaben/intro-commandline/repo`.

Expand All @@ -114,7 +114,7 @@ It is recommended to set them for this workshop:
$ git config --global init.defaultBranch main


<h2>Step 6 - ⭐ History <!-- UEB/The `git` command!/6 --></h2>
<h2>Step 6 - ⭐ History <!-- UEB/intro-commandline/6 --></h2>

Start in directory `git-uebungen/aufgaben/intro-commandline/repo`.

Expand All @@ -123,22 +123,22 @@ to execute one of the previous commands again.
Type `ctrl+r` and then enter `conflict`,
to re-run the command to set `merge.conflictStyle`.

<h2>Step 7 - ⭐ Configure Git editor <!-- UEB/The `git` command!/7 --></h2>
<h2>Step 7 - ⭐ Configure Git editor <!-- UEB/intro-commandline/7 --></h2>

Start in directory `git-uebungen/aufgaben/intro-commandline/repo`.

Configure an editor for git.
[Tips on this](https://git-scm.com/book/en/v2/Appendix-C%3A-Git-Commands-Setup-and-Config).f
Then test with `git config -e` to see if it worked.

<h2>Step 8 - ⭐ Working directory <!-- UEB/The `git` command!/8 --></h2>
<h2>Step 8 - ⭐ Working directory <!-- UEB/intro-commandline/8 --></h2>

Start in directory `git-uebungen/aufgaben/intro-commandline/repo`.

Print out which working directory you are currently in.
For Windows users: also test the command with the `-W` option.

<h2>Step 9 - ⭐ Open applications <!-- UEB/The `git` command!/9 --></h2>
<h2>Step 9 - ⭐ Open applications <!-- UEB/intro-commandline/9 --></h2>

Start in directory `git-uebungen/aufgaben/intro-commandline/repo`.

Expand Down
8 changes: 4 additions & 4 deletions markdown-git-uebungen-en/aufgabe-intro-hallo-welt.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ You will learn what the commands do in detail during the course.
* `git log` shows commits.


<h2>Step 0 - START <!-- UEB/Hello Git!/0 --></h2>
<h2>Step 0 - START <!-- UEB/intro-hallo-welt/0 --></h2>

<h2>Step 1 - The first repo <!-- UEB/Hello Git!/1 --></h2>
<h2>Step 1 - The first repo <!-- UEB/intro-hallo-welt/1 --></h2>

Start in directory `git-uebungen/aufgaben/intro-hallo-welt`.

Expand All @@ -34,7 +34,7 @@ Create your first repository with the following commands:
$ git commit -m 'Hello World!'
$ git log

<h2>Step 2 - ⭐ And another commit <!-- UEB/Hello Git!/2 --></h2>
<h2>Step 2 - ⭐ And another commit <!-- UEB/intro-hallo-welt/2 --></h2>

Start in directory `git-uebungen/aufgaben/intro-hallo-welt`.

Expand All @@ -45,7 +45,7 @@ Then look at the log.
$ git commit -am 'Here we go again!'
$ git log

<h2>Step 3 - ⭐ Where is the repository <!-- UEB/Hello Git!/3 --></h2>
<h2>Step 3 - ⭐ Where is the repository <!-- UEB/intro-hallo-welt/3 --></h2>

Start in directory `git-uebungen/aufgaben/intro-hallo-welt`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Two repositories
are already present.


<h2>Step 0 - START <!-- UEB/Merging small projects/0 --></h2>
<h2>Step 0 - START <!-- UEB/modularisierung-repositorys-zusammenfuehren/0 --></h2>

<h2>Step 1 - Merge `git subtree` <!-- UEB/Merging small projects/1 --></h2>
<h2>Step 1 - Merge `git subtree` <!-- UEB/modularisierung-repositorys-zusammenfuehren/1 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-repositorys-zusammenfuehren`.

Expand All @@ -45,7 +45,7 @@ Start in directory `git-uebungen/aufgaben/modularisierung-repositorys-zusammenfu
3. Add `ui.git` in a subdirectory `ui`.
4. Examine the directory structure and commit graph

<h2>Step 2 - Merge with `fetch`, `mv` and `merge` <!-- UEB/Merging small projects/2 --></h2>
<h2>Step 2 - Merge with `fetch`, `mv` and `merge` <!-- UEB/modularisierung-repositorys-zusammenfuehren/2 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-repositorys-zusammenfuehren`.

Expand Down
10 changes: 5 additions & 5 deletions markdown-git-uebungen-en/aufgabe-modularisierung-submodules.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ application/



<h2>Step 0 - START <!-- UEB/Modularization with Submodules/0 --></h2>
<h2>Step 0 - START <!-- UEB/modularisierung-submodules/0 --></h2>


<pre><code>$ <b>cd application</b><br><br><br></code></pre>


<h2>Step 1 - Integrating modules as submodules <!-- UEB/Modularization with Submodules/1 --></h2>
<h2>Step 1 - Integrating modules as submodules <!-- UEB/modularisierung-submodules/1 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-submodules/application`.

Expand All @@ -71,7 +71,7 @@ Then examine the resulting directory structure.
<pre><code>application $ <b>cd ..</b><br><br><br></code></pre>


<h2>Step 2 - Adopting changes from a module <!-- UEB/Modularization with Submodules/2 --></h2>
<h2>Step 2 - Adopting changes from a module <!-- UEB/modularisierung-submodules/2 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-submodules`.

Expand All @@ -80,15 +80,15 @@ Look at the resulting commit (`show --stat`)
Go to the `application/backend` repo and fetch the changes using `pull`.
Look at the transferred commit.

<h2>Step 3 - Transferring changes to a module <!-- UEB/Modularization with Submodules/3 --></h2>
<h2>Step 3 - Transferring changes to a module <!-- UEB/modularisierung-submodules/3 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-submodules`.

Go to `subtrees/frontend`, change `main.ts` and commit.
Transfer the change to `frontend.git` using `push`.
Look at the transferred commit in `frontend.git`.

<h2>Step 4 - Cloning the parent repo <!-- UEB/Modularization with Submodules/4 --></h2>
<h2>Step 4 - Cloning the parent repo <!-- UEB/modularisierung-submodules/4 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-submodules`.

Expand Down
10 changes: 5 additions & 5 deletions markdown-git-uebungen-en/aufgabe-modularisierung-subtrees.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ application/
```


<h2>Step 0 - START <!-- UEB/Modularization with Subtrees/0 --></h2>
<h2>Step 0 - START <!-- UEB/modularisierung-subtrees/0 --></h2>


<pre><code>$ <b>cd application</b><br><br><br></code></pre>


<h2>Step 1 - Integrating modules as subtrees <!-- UEB/Modularization with Subtrees/1 --></h2>
<h2>Step 1 - Integrating modules as subtrees <!-- UEB/modularisierung-subtrees/1 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-subtrees/application`.

Expand All @@ -68,7 +68,7 @@ Then examine the resulting directory structure.
<pre><code>application $ <b>cd ..</b><br><br><br></code></pre>


<h2>Step 2 - Adopting changes from a module <!-- UEB/Modularization with Subtrees/2 --></h2>
<h2>Step 2 - Adopting changes from a module <!-- UEB/modularisierung-subtrees/2 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-subtrees`.

Expand All @@ -77,15 +77,15 @@ Look at the resulting commit (`show --stat`)
Go to the `application` repo and fetch the changes using `subtree pull`.
Look at the transferred commit.

<h2>Step 3 - Transferring changes to a module <!-- UEB/Modularization with Subtrees/3 --></h2>
<h2>Step 3 - Transferring changes to a module <!-- UEB/modularisierung-subtrees/3 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-subtrees`.

Go to `application`, change `frontend/main.ts` and commit.
Transfer the change to `frontend.git` using `subtree push`.
Look at the transferred commit in `frontend.git`.

<h2>Step 4 - Cloning the parent repo <!-- UEB/Modularization with Subtrees/4 --></h2>
<h2>Step 4 - Cloning the parent repo <!-- UEB/modularisierung-subtrees/4 --></h2>

Start in directory `git-uebungen/aufgaben/modularisierung-subtrees`.

Expand Down
8 changes: 4 additions & 4 deletions markdown-git-uebungen-en/aufgabe-repository-klonen.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ It contains two commits.
- `myfirstrepo/` Existing repository.


<h2>Step 0 - START <!-- UEB/Cloning Repositories/0 --></h2>
<h2>Step 0 - START <!-- UEB/repository-klonen/0 --></h2>

<h2>Step 1 - Perform clone <!-- UEB/Cloning Repositories/1 --></h2>
<h2>Step 1 - Perform clone <!-- UEB/repository-klonen/1 --></h2>

Start in directory `git-uebungen/aufgaben/repository-klonen`.

Create a clone of `myfirstrepo` named `myfirstclone`.

<h2>Step 2 - Examine clone <!-- UEB/Cloning Repositories/2 --></h2>
<h2>Step 2 - Examine clone <!-- UEB/repository-klonen/2 --></h2>

Start in directory `git-uebungen/aufgaben/repository-klonen`.

Expand All @@ -43,7 +43,7 @@ show the origin of the clone `myfirstclone`.
from which it was cloned.
Then show the status.

<h2>Step 3 - Work in the clone <!-- UEB/Cloning Repositories/3 --></h2>
<h2>Step 3 - Work in the clone <!-- UEB/repository-klonen/3 --></h2>

Start in directory `git-uebungen/aufgaben/repository-klonen`.

Expand Down
Loading