Skip to content

Commit 8e9d741

Browse files
authored
Merge pull request #6 from biosustain/updates
Updates
2 parents d3396c9 + 61e9276 commit 8e9d741

File tree

10 files changed

+308
-151
lines changed

10 files changed

+308
-151
lines changed

.github/workflows/build_website.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ jobs:
3838
# # set it to a subfolder of the root to keep all PR previews:
3939
# destination_dir: latest
4040
# cname: website.com
41-
- if: ${{ github.ref != 'refs/heads/main' }}
42-
name: Save to gh-pages
41+
- name: Save to gh-pages
4342
uses: peaceiris/actions-gh-pages@v4
4443
with:
4544
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# Byte-compiled Python files
2+
__pycache__/
3+
4+
# data
5+
*.csv
6+
*.json
7+
*.parquet
8+
9+
# C extensions
10+
*.so
11+
12+
# Mac OS
13+
.DS_Store
14+
*/.DS_Store
15+
16+
# Distribution / packaging
17+
dist/
18+
eggs/
19+
20+
121
.npm
222
.yarn
323
.cache

README.md

Lines changed: 34 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,71 @@
11
# Git Tutorial
22

3-
Sign-Up to the workshop here (being logged in with your DTU Microsoft account): [Sign-Up Form](
4-
https://forms.office.com/e/62H1nV61R0)
3+
Sign-Up to the workshop here (being logged in with your DTU Microsoft account): [Sign-Up Form](https://forms.office.com/e/62H1nV61R0)
54

65
## Announcement
76

87
This workshop will give you the opportunity to practice git as a version control system
9-
and Github as a website to host your repositories. Using git you can track changes in
8+
and Github as a website to host your repositories. Using git you can track changes in
109
folders. It allows you track your progress and to spot random typos when working on
11-
many projects and tasks in parallel. In the workshop you will get the time to practice
10+
many projects and tasks in parallel. In the workshop you will get the time to practice
1211
the fundamental concepts and actions directly in your browser - either using VSCode in
13-
GitHub Codespaces or in using the GitHub web interface. If you want, you can also try
12+
GitHub Codespaces or in using the GitHub web interface. If you want, you can also try
1413
everything on your local computer.
1514

16-
I will give a brief introduction to git. Then you will specific workflows by
15+
I will give a brief introduction to git. Then you will specific workflows by
1716
collaboratively work on extending a [recipe book](https://enryh.github.io/recipe-book/)
1817
(please bring a recipe you like).
19-
You will learn how to work on
20-
[branches](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches),
21-
review [Pull Requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
22-
and merge them into the main branch. If you have specific requests, feel free to reach out to me.
18+
You will learn how to work on
19+
[branches](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches),
20+
review [Pull Requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
21+
and merge them into the main branch. If you have specific requests, feel free to reach out to me.
2322

2423
If you have specific requests, feel free to reach out to [me](mailto:[email protected]) and/or write it down in the sign-up form.
2524

2625
What you'll learn:
26+
2727
- Basic tasks and actions to perform with git (in VSCode or in the browser)
2828
- How to branch and tag
2929
- Follow trunk-based development
3030
- See how to merge and comment a Pull Request based on a branch
3131
- Solve merge conflicts
3232
- Familiarize yourself with VSCode’s and GitHub’s interface and user experience
3333
- Get to know new recipes
34-
35-
Minimal prerequisite: A [GitHub account](https://github.com/signup).
36-
If you want to follow along locally, please install
37-
[GitHub Desktop](https://desktop.github.com/download/) and
34+
35+
Minimal prerequisite: A [GitHub account](https://github.com/signup).
36+
If you want to follow along locally, please install
37+
[GitHub Desktop](https://desktop.github.com/download/) and
3838
[VSCode](https://code.visualstudio.com/) on your machine.
3939

4040
### Brief timeline of the workshop:
4141

42-
| Time | Activity |
43-
|---------------|----------------------------------------------|
44-
| 10:00 - 10:15 | Coffee and snacks 🥐 |
45-
| 10:15 - 10:45 | Introduction and example workflow |
46-
| 10:45 - 12:00 | Working collaboratively on the recipe book |
47-
| 12:00 - 12:30 | lunch break (not included) |
48-
| 12:30 - 13:30 | Your question and advanced content |
42+
| Time | Activity |
43+
| ------------- | ------------------------------------------ |
44+
| 10:00 - 10:15 | Coffee and snacks 🥐 |
45+
| 10:15 - 10:45 | Introduction and example workflow |
46+
| 10:45 - 12:00 | Working collaboratively on the recipe book |
47+
| 12:00 - 12:30 | lunch break (not included) |
48+
| 12:30 - 13:30 | Your question and advanced content |
4949

50-
## Explore locally
50+
## Slides
5151

52-
You will need to setup your git email and user-name
53-
(replace with yours in case you want to commit something, otherwise use copy-paste)
52+
<iframe
53+
src="https://docs.google.com/presentation/d/1RsKMiKquE4wqncrAv9LEtjivGE_dGiHoJ8nKCxgVKeY/embed?slide=id.p#slide=id.p"
54+
frameborder="0"
55+
width="100%" height="480"
56+
allowfullscreen="true"
57+
mozallowfullscreen="true"
58+
webkitallowfullscreen="true">
59+
</iframe>
5460

55-
```bash
56-
git config --global user.email "[email protected]"
57-
git config --global user.name "Your Name"
58-
```
59-
> could be added to local config using `git config user...`
61+
## Local Setup
6062

63+
See [local_setup](local_setup.md) for instructions to setup git on your local computer.
6164

6265
## Links to learn more
6366

6467
- [git-intro by coderefinery](https://coderefinery.github.io/git-intro/#)
6568
- [git-moji](https://gitmoji.dev/)
6669
- [Git Internals - Plumbing and Porcelain](https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain)
67-
- [Glossary of terms (technical for git)](https://www.git-scm.com/docs/gitglossary)
68-
- [GitHub Glossary terms](https://docs.github.com/en/get-started/learning-about-github/github-glossary)
69-
70-
71-
## Git under the hood (Extended version)
72-
73-
> Extended content for those interested in how git works under the hood
74-
75-
You can find a recording of the
76-
[talk](https://www.youtube.com/watch?v=cAU3BCUkHxM)
77-
([slides](https://docs.google.com/presentation/d/1RsKMiKquE4wqncrAv9LEtjivGE_dGiHoJ8nKCxgVKeY/edit?usp=sharing))
78-
and [hands-on tutorial](https://www.youtube.com/watch?v=5iB7qc5zRjQ)
79-
on YouTube which was done for the Data Club seminar
80-
between DTU biosustain and DTU bioengineering (see sections in description of Video).
81-
82-
Talk:
83-
[![Recording of talk](https://img.youtube.com/vi/cAU3BCUkHxM/maxresdefault.jpg
84-
)](https://www.youtube.com/watch?v=cAU3BCUkHxM)
85-
86-
Live Demo:
87-
[![Live Demo of Hands On part](https://img.youtube.com/vi/5iB7qc5zRjQ/maxresdefault.jpg
88-
)](https://www.youtube.com/watch?v=5iB7qc5zRjQ)
89-
90-
The above Live Demo is not pulling the merge commit after merging the branch on GitHub:
91-
[github.com/biosustain/git_training_henry_recording](https://github.com/biosustain/git_training_henry_recording)
92-
93-
I show the merge commit in the video below, cloining the recording repository in a newly
94-
create VSCode sandbox environment above:
95-
96-
[![Live Demo Hand on Addon](https://img.youtube.com/vi/gcfzruIJ-rw/sddefault.jpg
97-
)](https://www.youtube.com/watch?v=gcfzruIJ-rw)
98-
99-
100-
### Instructions
101-
102-
- create a folder with an empty repository (default `examples`
103-
directly openend in VSCode on binder)
104-
- open instruction: `code-server ../README.md` (local computer: `code ../README.md`)
105-
- `git init` in console to initialize repo (or via command palette "Git: Initialize Repository")
106-
- setup user.name and user.email (see above)
107-
- create files, stage them and see what files are created in `.git/objects`
108-
- commit files and check `.git/objects`
109-
- create branches and checkout `.git/refs` (`git/branches` is a legacy folder,see
110-
[here](https://stackoverflow.com/a/10398507/9684872))
111-
- look at `git/HEAD` (maybe `git/ORIG_HEAD` if it exists)
112-
113-
> try to create your own fork, and try to lauch it on [mybinder](https://mybinder.org/)
114-
115-
### Inspect git objects
116-
117-
```bash
118-
git log --format=raw
119-
git cat-file -p <hash> # pretty print
120-
git cat-file -t <hash> # type
121-
122-
# the binary object can also be inspected using different tools,
123-
# which might make it easier to navigate to certain blobs:
124-
cat .git/objects/<2c>/<38c> | zlib-flate -uncompress
125-
```
126-
127-
You can find the latest objects and compare it to the log
128-
129-
```bash
130-
find .git/objects -type f -exec ls -lt {} + | head -n 10
131-
git log --format=raw -n 3
132-
```
133-
134-
If you wonder what the codes in a tree mean, check this stackexchange
135-
[answer](https://unix.stackexchange.com/a/450488/349761)
136-
137-
138-
### What's happening?
139-
140-
Can you explain what happens in the following scenarios?
141-
142-
- You committed ten commits and did not yet push. Git complains about too much data.
143-
You realize that you committed your source data. You delete it and commit again,
144-
but the problem still persists.
145-
- You commit something and push. You realize your last commit was wrong. You undo it
146-
and commit again. Git complains that you cannot push.
147-
148-
### Git internals resources
149-
150-
- [curious git](https://matthew-brett.github.io/curious-git/) - detailed intro to the
151-
inner workings
152-
- [git parable](http://practical-neuroimaging.github.io/git_parable.html) - why git came to exist
153-
- Videos:
154-
- [Python-Git-Client](https://www.youtube.com/watch?v=xvzo_nV9PjU)
155-
- [Git-Interals](https://www.youtube.com/watch?v=MYP56QJpDr4) - shows how git works
156-
- [Git PyData Global 2021 talk](https://www.youtube.com/watch?v=rBYC3dEOOyI)
157-
- Scoot Chacon’s [“So you thin you know git” talk](https://www.youtube.com/watch?v=aolI_Rz0ZqY) (FOSDEM 2024),
158-
notes on [blog](https://blog.gitbutler.com/git-tips-1-theres-a-git-config-for-that/)
70+
- [Glossary of terms for git](https://www.git-scm.com/docs/gitglossary)
71+
- [Glossary terms for GitHub](https://docs.github.com/en/get-started/learning-about-github/github-glossary)

advanced.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
2+
# Git under the hood
3+
4+
> Extended content for those interested in how git works under the hood
5+
6+
You can find a recording of the
7+
[talk](https://www.youtube.com/watch?v=cAU3BCUkHxM)
8+
([slides](https://docs.google.com/presentation/d/1RsKMiKquE4wqncrAv9LEtjivGE_dGiHoJ8nKCxgVKeY/edit?usp=sharing))
9+
and [hands-on tutorial](https://www.youtube.com/watch?v=5iB7qc5zRjQ)
10+
on YouTube which was done for the Data Club seminar
11+
between DTU biosustain and DTU bioengineering (see sections in description of Video).
12+
13+
Talk:
14+
[![Recording of talk](https://img.youtube.com/vi/cAU3BCUkHxM/maxresdefault.jpg)](https://www.youtube.com/watch?v=cAU3BCUkHxM)
15+
16+
Live Demo:
17+
[![Live Demo of Hands On part](https://img.youtube.com/vi/5iB7qc5zRjQ/maxresdefault.jpg)](https://www.youtube.com/watch?v=5iB7qc5zRjQ)
18+
19+
The above Live Demo is not pulling the merge commit after merging the branch on GitHub:
20+
[github.com/biosustain/git_training_henry_recording](https://github.com/biosustain/git_training_henry_recording)
21+
22+
I show the merge commit in the video below, cloining the recording repository in a newly
23+
create VSCode sandbox environment above:
24+
25+
[![Live Demo Hand on Addon](https://img.youtube.com/vi/gcfzruIJ-rw/sddefault.jpg)](https://www.youtube.com/watch?v=gcfzruIJ-rw)
26+
27+
## Instructions
28+
29+
- create a folder with an empty repository (default `examples`
30+
directly openend in VSCode on binder)
31+
- open instruction: `code-server ../README.md` (local computer: `code ../README.md`)
32+
- `git init` in console to initialize repo (or via command palette "Git: Initialize Repository")
33+
- setup user.name and user.email (see above)
34+
- create files, stage them and see what files are created in `.git/objects`
35+
- commit files and check `.git/objects`
36+
- create branches and checkout `.git/refs` (`git/branches` is a legacy folder,see
37+
[here](https://stackoverflow.com/a/10398507/9684872))
38+
- look at `git/HEAD` (maybe `git/ORIG_HEAD` if it exists)
39+
40+
> try to create your own fork, and try to lauch it on [mybinder](https://mybinder.org/)
41+
42+
## Inspect git objects
43+
44+
```bash
45+
git log --format=raw
46+
git cat-file -p <hash> # pretty print
47+
git cat-file -t <hash> # type
48+
49+
# the binary object can also be inspected using different tools,
50+
# which might make it easier to navigate to certain blobs:
51+
cat .git/objects/<2c>/<38c> | zlib-flate -uncompress
52+
```
53+
54+
You can find the latest objects and compare it to the log
55+
56+
```bash
57+
find .git/objects -type f -exec ls -lt {} + | head -n 10
58+
git log --format=raw -n 3
59+
```
60+
61+
If you wonder what the codes in a tree mean, check this stackexchange
62+
[answer](https://unix.stackexchange.com/a/450488/349761)
63+
64+
## What's happening?
65+
66+
Can you explain what happens in the following scenarios?
67+
68+
- You committed ten commits and did not yet push. Git complains about too much data.
69+
You realize that you committed your source data. You delete it and commit again,
70+
but the problem still persists.
71+
- You commit something and push. You realize your last commit was wrong. You undo it
72+
and commit again. Git complains that you cannot push.
73+
74+
## Git internals resources
75+
76+
- [curious git](https://matthew-brett.github.io/curious-git/) - detailed intro to the
77+
inner workings
78+
- [git parable](http://practical-neuroimaging.github.io/git_parable.html) - why git came to exist
79+
- Videos:
80+
- [Python-Git-Client](https://www.youtube.com/watch?v=xvzo_nV9PjU)
81+
- [Git-Interals](https://www.youtube.com/watch?v=MYP56QJpDr4) - shows how git works
82+
- [Git PyData Global 2021 talk](https://www.youtube.com/watch?v=rBYC3dEOOyI)
83+
- Scoot Chacon’s [“So you thin you know git” talk](https://www.youtube.com/watch?v=aolI_Rz0ZqY) (FOSDEM 2024),
84+
notes on [blog](https://blog.gitbutler.com/git-tips-1-theres-a-git-config-for-that/)

index.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
```{include} README.md
2-
```
32
3+
```
44

55
```{toctree}
66
:maxdepth: 1
77
:hidden:
8+
:caption: Basic introduction
89
910
instructions_251105
10-
instructions_241113
1111
12+
use_cases
13+
local_setup
14+
receipe_book
15+
```
1216

17+
```{toctree}
18+
:maxdepth: 1
19+
:hidden:
20+
:caption: Advanced content
21+
22+
advanced
23+
instructions_241113
1324
```

0 commit comments

Comments
 (0)