Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 6a18ab6

Browse files
author
Michael Friedrich
authored
Merge pull request #3 from NETWAYS/feature/update-global-style
Update global style and bump to showoff 0.9.16
2 parents 37c1a47 + 535848b commit 6a18ab6

File tree

259 files changed

+57094
-7626
lines changed

Some content is hidden

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

259 files changed

+57094
-7626
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ RUN cd $HOME \
3333
&& tar vxf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz \
3434
&& cp wkhtmltox/bin/wk* /usr/local/bin/
3535

36-
RUN gem install showoff --version=0.9.11.1
36+
RUN gem install showoff --version=0.19.6
3737

3838
CMD "/bin/bash"

day1/01_Introduction/03_Basics.md

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
!SLIDE smbullets noprint
1717
# Snapshots and Differences
1818
19-
* Information as a list of file-based changes
2019
* File changes and deltas over time
2120
* Git Commit, take snapshot, store reference to that snapshot
2221
* Set of snapshots of a mini-filesystem
@@ -27,7 +26,6 @@
2726
!SLIDE smbullets printonly
2827
# Snapshots and Differences
2928
30-
* Information as a list of file-based changes
3129
* File changes and deltas over time
3230
* Git Commit, take snapshot, store reference to that snapshot
3331
* Set of snapshots of a mini-filesystem

day1/03_Basics/03_Changes.md

+22-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
!SLIDE smbullets
2-
# Work on current changes
2+
# Add current changes
33

44
* `git add`
55
* Add (modified) file(s) from the working directory into the staging index.
66
* `git mv`
77
* Rename file(s) tracked by Git.
8-
* `git reset`
9-
* Reset files added to the staging index.
10-
* `--soft` keeps the changes (default), `--hard` removes them indefinitely.
11-
* `git rm`
12-
* Remove the file(s) from working tree and Git repository.
13-
* Note that file(s) will be visible in Git history, and can be restored from it.
148

159
~~~SECTION:handouts~~~
1610
@@ -22,11 +16,30 @@ waiting for the commit.
2216
`git mv` renames an existing file tracking the change for the commit. If you
2317
manually move the file, you will need to rm and add it again.
2418
19+
~~~ENDSECTION~~~
20+
21+
22+
!SLIDE smbullets
23+
# Remove changes
24+
25+
* `git reset`
26+
* Reset files added to the staging index.
27+
* `--soft` keeps the changes (default), `--hard` removes them indefinitely.
28+
* `git rm`
29+
* Remove the file(s) from working tree and Git repository.
30+
* Note that file(s) will be visible in Git history, and can be restored from it.
31+
32+
~~~SECTION:handouts~~~
33+
34+
****
35+
2536
`git reset` resets files added to the staging index.
2637
2738
`git rm` removes the file from the working tree and also from the git index.
2839
2940
~~~ENDSECTION~~~
41+
42+
3043
!SLIDE smbullets small
3144
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Add a new README.md file
3245
@@ -42,8 +55,8 @@ manually move the file, you will need to rm and add it again.
4255
Best practice is to have a README.md file written in Markdown
4356
in every project. This gets rendered by GitHub/GitLab in readable HTML.
4457
45-
> During this training we will learn many new things. Keep notes
46-
> in the README.md file.
58+
During this training we will learn many new things. Keep notes
59+
in the `README.md` file.
4760
4861
~~~SECTION:handouts~~~
4962

day1/04_Commits/03_Good_Commits.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* `git add -p` for interactive selection of changes in a file
77
* `git commit <file1> <file2>`
88
* Enable the verbose mode `-v` to show the differences below the editor
9-
* `git commit` uses the `EDITOR` environment variable to detect your preferred editor
9+
* Write a short summary based on the visible changes
1010

1111
~~~SECTION:handouts~~~
1212

day1/04_Commits/04_History.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44
* `git log`
55
* Show commit history of the current branch.
66
* Supports `-10` notation to show a limited number of commits.
7+
8+
~~~SECTION:handouts~~~
9+
10+
****
11+
12+
`git log` shows the commit history of the current branch.
13+
14+
15+
~~~ENDSECTION~~~
16+
17+
!SLIDE smbullets
18+
# Examine the Git history
19+
720
* `git show`
821
* Print commit details.
922
* If the commit id is omitted, the last commit is printed.
@@ -17,8 +30,6 @@
1730
1831
****
1932
20-
`git log` shows the commit history of the current branch.
21-
2233
`git show` will print the last commit details. If you want to print a specific commit id, add
2334
it afterwards.
2435
@@ -27,7 +38,6 @@ also compare specific commits.
2738
2839
~~~ENDSECTION~~~
2940
30-
3141
!SLIDE smbullets
3242
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Examine the Commit History
3343

day1/04_Commits/05_Amend.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ problems in collaboration with others.
2828
* Modify `README.md` and add docs about amend
2929
* Add `README.md` to the staging index and commit the change
3030
* Edit `README.md` again and add it to staging
31-
* Use `git commit --amend README.md` to add the change to the previous commit
31+
* Use `git commit --amend README.md` and explain what happens
3232
* Bonus:
3333
* Adopt the commit message using `git commit --amend`
3434

day1/05_Branching/01_Intro.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ environment.
9595
* List the branches with `git branch`
9696
* Checkout the new branch with `git checkout feature/docs`
9797
* Bonus:
98-
* Verify how `git checkout -b feature/docs2` works
99-
* Explain how it helps here
98+
* Explain `git checkout -b feature/docs2`
10099
101100
~~~SECTION:handouts~~~
102101

day1/06_Server/02_Gitlab_Introduction.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ GitLab is available as self-hosted or cloud based repository management
55
system.
66

77
* Git repositories
8-
* User and group management
9-
* Fine granular permissions (branch protection, etc.)
8+
* User and group management and fine granular permissions
109
* Issue tracking and project management (dashboards, etc.)
1110
* Merge, review, report
12-
* Continuous integration (CI)
11+
* Continuous integration/deployment (CI/CD)
1312

1413
Hosted: https://www.netways.de/managed_hosting/gitlab_ce_hosting/
1514

day1/06_Server/04_Connect_Local_Remote.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,9 @@ If not set, you can set it explicitly.
191191
* Add the GitLab project as remote origin
192192
* Steps
193193
* Open the project in GitLab and extract the `HTTPS` clone URL
194-
* Navigate into your local repository
194+
* Navigate into your local repository in `$HOME/training`
195195
* Use `git remote add origin <remoteurl>`
196-
* Push your local history
197-
* Use `--set-upstream` (short: `-u`) to enable the local branch tracking the remote repository
196+
* Push your local history with `--set-upstream` (short: `-u`)
198197
* Bonus
199198
* Set default push method to `simple`
200199
@@ -280,7 +279,7 @@ In order to fix that, add the default push method to your global configuration.
280279
* Compare the local history to the remote project's history
281280
* Steps:
282281
* Click on `History` in the project view and examine the Git commits
283-
* Run `git log` on your shell and compare them to GitLab
282+
* Run `git log` or `tig` on your shell and compare them to GitLab
284283
285284
~~~SECTION:handouts~~~
286285
@@ -305,7 +304,7 @@ In order to fix that, add the default push method to your global configuration.
305304
****
306305
307306
* Click on `History` in the project view and examine the Git commits
308-
* Run `git log` on your shell and compare them to GitLab
307+
* Run `git log` or `tig` on your shell and compare them to GitLab
309308
310309
311310
!SLIDE supplemental solutions
@@ -320,7 +319,7 @@ In order to fix that, add the default push method to your global configuration.
320319
321320
Choose `History` and look at the Git commits, their author, subject and timestamp.
322321
323-
Compare it with the local `git log` entries.
322+
Compare it with the local `git log` or `tig` entries.
324323
325324
326325

day1/07_Collaboration/02_Collaboration.md

+23-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
# Collaboration with others
33

44
* `git fetch`
5-
* Get the remote branch reference pointer to the latest commit and cache it locally.
5+
* Update the remote branch reference pointers to the latest commit and cache it locally.
6+
* Does not pull in any remote commit history.
67
* `git pull`
7-
* Fetch and update the local history from remote repository. This pulls in source code changes and commits.
8-
* `git push`
9-
* Update remote references and push local history to remote repository. This pushes source code changes and commits.
10-
* `git remote`
11-
* Configure/list remote repository URLs (default `origin`).
8+
* Fetch and update the local history from remote repository (implicit fetch).
9+
* This pulls in source code changes and commits.
1210

1311
~~~SECTION:handouts~~~
1412
@@ -18,6 +16,25 @@
1816
1917
`git pull` invokes a fetch and updates the local history with commits from the remote repository.
2018
19+
20+
~~~ENDSECTION~~~
21+
22+
23+
!SLIDE smbullets
24+
# Collaboration with others
25+
26+
* `git push`
27+
* Update remote references and push local history to remote repository.
28+
* This pushes source code changes and commits.
29+
* Halts if the remote history diverged from your local history.
30+
* `git remote`
31+
* Configure/list remote repository URLs (default `origin`).
32+
33+
~~~SECTION:handouts~~~
34+
35+
****
36+
37+
2138
`git push` updates remote references and pushes your local commit history to the remote repository.
2239
2340
`git remote` allows you to configure and list the remote repository. By default this is called `origin`.

day1/07_Collaboration/04_Advanced.md

-7
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
* Put current changes on a temporary stack.
66
* `git cherry-pick`
77
* Collect specific commit into your working tree.
8-
* `git reset`
9-
* Remove the current commit(s).
10-
* `--soft` adds changes to the staging index.
11-
* `--hard` drops them indefinitely.
12-
* `git archive`
13-
* Create tarball without the `.git directory`.
148

159
~~~SECTION:handouts~~~
1610
@@ -24,7 +18,6 @@ where your uncommitted changes will not apply.
2418
Use `git stash pop` to fetch the changes again. You can stash multiple uncommitted
2519
stages, `git stash list` will list them.
2620
27-
`git archive` creates a tarball from the given working tree (HEAD or tag).
2821
~~~ENDSECTION~~~
2922
3023

day2/01_Workflows/02_Centralized.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,12 @@ for integrating and sharing code changes between repositories.
9595
* Objective:
9696
* Clone the training repository twice and add diverging commits
9797
* Steps:
98-
* Clone the `training.git` repository into `$HOME/training1`
99-
* Clone the `training.git` repository into `$HOME/training2`
98+
* Clone the `training.git` repository into `$HOME/training1` and `$HOME/training2`
10099
* Steps for both:
101100
* Change into each directory
102101
* Add/modify a file and commit the change
103102
* Push your change to the remote repository
104-
* Next steps:
105-
* Explain the error message after the second push
103+
* Explain the error message after the second push
106104
107105
108106
!SLIDE supplemental exercises
@@ -201,13 +199,11 @@ The last parameter specifies the target directory `training2`.
201199
* Objective:
202200
* Rebase your local history with the remote repository
203201
* Steps:
204-
* Change into `$HOME/training`
205202
* Reset the local history by 2 commits with `git reset --hard HEAD~2`
206203
* Update and commit README.md
207-
* Fetch the remote repository and use `git diff origin/master` to compare the changes
208-
* Rebase the master branch against the remote master branch with `git rebase origin/master`
209-
* Resolve possible merge conflicts, add them and continue with `git rebase --continue`
210-
* Push your rebased history
204+
* Fetch remote and compare with `git diff origin/master`
205+
* Rebase with `git rebase origin/master`
206+
* Resolve possible merge conflicts, add them and continue with `git rebase --continue`, push rebased history
211207
212208
Hint: `>>>` marks conflicts and show the differences on merge.
213209

day2/01_Workflows/03_Feature_Branch.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,11 @@ The new branch `feature/docs-workflows` will be based on the `master` branch.
119119
* Update `master` branch and merge feature branch `feature/docs-workflows`
120120
121121
* Steps:
122-
* Change into `$HOME/training`
123122
* Checkout the feature branch `feature/docs-workflows`
124123
* Edit `README.md`, add and commit the changes
125124
* Diff the feature branch to the current master with `git diff master`
126-
* Checkout the `master` branch
127-
* Merge the feature branch as non-fast-forward with `--no-ff`
128-
* Show the history tree with `tig` or inside GitLab
129-
130-
* Bonus:
131-
* Explain why the forced merge commit with `--no-ff` is important
125+
* Checkout the `master` branch, merge the feature branch as non-fast-forward with `--no-ff`
126+
* Show the history tree with `tig` or inside GitLab and explain why the forced merge commit with `--no-ff` is important
132127
133128
~~~SECTION:handouts~~~
134129

day2/01_Workflows/06_Github_Gitlab_Flow.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020
# Forking Workflow - How it works
2121
2222
* Developers fork, commit and push into their own repository
23-
* Developers create a `Pull Request` for the official repository
24-
* CI triggers automated tests for the PR
25-
* Developers/Maintainers review and merge PR
26-
* CI triggers deployment task
23+
* Developers create a `Pull Request` for the official repository, CI triggers automated tests for the PR
24+
* Developers/Maintainers review and merge PR, CI triggers deployment task
2725
2826
<center><img src="../../_images/workflows/git_github_workflow.png" alt="GitHub Workflow"/></center>
2927

day2/01_Workflows/08_Rebase_Squash.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ all commits into one commit.
1212
commit2
1313
commit3
1414

15+
Ask the trainer to draw an image for better illustration and discussion.
16+
1517
!SLIDE smbullets
1618
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Rebase and squash commits
1719

day2/03_CI/04_Gitlab_CI.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -576,11 +576,9 @@ Example:
576576
* Objective:
577577
* Create HTML docs from Markdown
578578
* Steps:
579-
* Add a new job `markdown` after the `all_tests` job
580-
* Add `script` and convert `README.md` to `README.html` using Python
581-
* Add `archifacts` with `paths` pointing to `README.html`. Expires in `1 week`.
582-
* Commit and push the changes
583-
* Download and view the `README.html` file in your browser
579+
* Add a new `markdown` and use `script` to generate `README.html`
580+
* Add `archifacts` with `paths` pointing to `README.html`. Expires in `1 week`
581+
* Commit and push the changes, then download and view the `README.html` file in your browser
584582
585583
Example:
586584

global/Post/03_Contributing.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
!SLIDE noprint center
2+
# Contributing
3+
4+
Contribute to the GitLab training on [GitHub](https://github.com/NETWAYS/gitlab-training) to make it even better.
5+
6+
Material is licensed under [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](http://creativecommons.org/licenses/by-nc-sa/4.0/).
7+
8+
9+
!SLIDE noprint smbullets
10+
# Contributors
11+
12+
* Michael Friedrich
13+
* Markus Waldm&uuml;ller

global/Pre/External/JP.md

-5
This file was deleted.

global/Pre/Hints/01_Hints.md

-7
This file was deleted.

0 commit comments

Comments
 (0)