1- # Git Tutorial using
2-
3- > VS Code on Binder
4- > VS Code on Binder, because sometimes you need a real editor.
5-
6- [ ![ PyPI] ( https://img.shields.io/pypi/v/jupyter-vscode-proxy )] ( https://pypi.org/project/jupyter-vscode-proxy/ )
7- [ ![ Install with conda] ( https://img.shields.io/conda/vn/conda-forge/jupyter-vscode-proxy.svg )] ( https://github.com/conda-forge/jupyter-vscode-proxy-feedstock )
8-
9- Start:
10- - lab: [ ![ Binder] ( https://mybinder.org/badge_logo.svg )] ( https://mybinder.org/v2/gh/biosustain/git-tutorial/master?urlpath=lab )
11- - vscode: [ ![ Binder] ( https://mybinder.org/badge_logo.svg )] ( https://mybinder.org/v2/gh/biosustain/git-tutorial/master?urlpath=vscode?folder=/home/jovyan/examples )
12-
13-
14- ## Explore
1+ # Git Tutorial
2+
3+ Open in Codespace...
4+
5+ ## Announcement
6+
7+ This workshop will give you the opportunity to practice git as a version control system
8+ and Github as a website to host your repositories. Using git you can track changes in
9+ folders. It allows you track your progress and to spot random typos when working on
10+ many projects and tasks in parallel. In the workshop you will get the time to practice
11+ the fundamental concepts and actions directly in your browser - either using VSCode in
12+ GitHub Codespaces or in using the GitHub web interface. If you want, you can also try
13+ everything on your local computer.
14+
15+ I will give a brief introduction to git to then team you up to practice certain workflows.
16+ You will collaboratively work on creating a recipe book. You will learn how to work on
17+ branches, Review Pull Requests and merge them into the main branch.
18+
19+ If you have specific requests, feel free to reach out to me.
20+
21+ What you'll learn:
22+ - Basic tasks and actions to perform with git (in VSCode)
23+ - How to branch and tag
24+ - Follow trunk-based development
25+ - See how to merge and comment a Pull Request based on a branch
26+ - Solve merge conflicts
27+ - Familiarize yourself with VSCode’s and GitHub’s interface and user experience
28+ - Get to know new recipes
29+
30+ Minimal prerequisite: A [ GitHub account] ( https://github.com/signup ) .
31+ If you want to follow along locally, please install
32+ [ GitHub Desktop] ( https://desktop.github.com/download/ ) and
33+ [ VSCode] ( https://code.visualstudio.com/ ) on your machine.
34+
35+
36+ ## Explore locally
1537
1638You will need to setup your git email and user-name
1739(replace with yours in case you want to commit something, otherwise use copy-paste)
@@ -22,19 +44,19 @@ git config --global user.name "Your Name"
2244```
2345> could be added to local config using ` git config user... `
2446
25- ### Steps
2647
27- - create a folder with an empty repository (default ` examples `
28- directly openend in VSCode on binder)
29- - open instruction: ` code-server ../README.md ` (local computer: ` code ../README.md ` )
30- - ` git init ` in console to initialize repo (or via command palette "Git: Initialize Repository")
31- - setup user.name and user.email (see above)
32- - create files, stage them and see what files are created in ` .git/objects `
33- - commit files and check ` .git/objects `
34- - create branches and checkout ` .git/refs ` (` git/branches ` is a legacy folder,see [ here] ( https://stackoverflow.com/a/10398507/9684872 ) )
35- - look at ` git/HEAD ` (maybe ` git/ORIG_HEAD ` if it exists)
48+ ## Links to learn more
3649
37- > try to create your own fork, and try to lauch it on [ mybinder] ( https://mybinder.org/ )
50+ - [ git-intro by coderefinery] ( https://coderefinery.github.io/git-intro/# )
51+ - [ git-moji] ( https://gitmoji.dev/ )
52+ - [ Git Internals - Plumbing and Porcelain] ( https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain )
53+ - [ Glossary of terms (technical for git)] ( https://www.git-scm.com/docs/gitglossary )
54+ - [ GitHub Glossary terms] ( https://docs.github.com/en/get-started/learning-about-github/github-glossary )
55+
56+
57+ ## Git under the hood (Extended version)
58+
59+ > Extended content for those interested in how git works under the hood
3860
3961You can find a recording of the
4062[ talk] ( https://www.youtube.com/watch?v=cAU3BCUkHxM )
@@ -60,23 +82,23 @@ create VSCode sandbox environment above:
6082[ ![ Live Demo Hand on Addon] (https://img.youtube.com/vi/gcfzruIJ-rw/sddefault.jpg
6183)] ( https://www.youtube.com/watch?v=gcfzruIJ-rw )
6284
63- ## Links
6485
65- - [ git-intro by coderefinery] ( https://coderefinery.github.io/git-intro/# )
66- - [ git-moji] ( https://gitmoji.dev/ )
67- - [ curious git] ( https://matthew-brett.github.io/curious-git/ ) - detailed intro to the inner workings
68- - [ git parable] ( http://practical-neuroimaging.github.io/git_parable.html ) - why git came to exist
69- - Videos:
70- - [ Python-Git-Client] ( https://www.youtube.com/watch?v=xvzo_nV9PjU )
71- - [ Git-Interals] ( https://www.youtube.com/watch?v=MYP56QJpDr4 ) - shows how git works
72- - [ Git PyData Global 2021 talk] ( https://www.youtube.com/watch?v=rBYC3dEOOyI )
73- - Scoot Chacon’s [ “So you thin you know git” talk] ( https://www.youtube.com/watch?v=aolI_Rz0ZqY ) (FOSDEM 2024),
74- notes on [ blog] ( https://blog.gitbutler.com/git-tips-1-theres-a-git-config-for-that/ )
75- - [ Git Internals - Plumbing and Porcelain] ( https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain )
76- - [ Glossary of terms (technical for git)] ( https://www.git-scm.com/docs/gitglossary )
77- - [ GitHub Glossary terms] ( https://docs.github.com/en/get-started/learning-about-github/github-glossary )
86+ ### Instructions
87+
88+ - create a folder with an empty repository (default ` examples `
89+ directly openend in VSCode on binder)
90+ - open instruction: ` code-server ../README.md ` (local computer: ` code ../README.md ` )
91+ - ` git init ` in console to initialize repo (or via command palette "Git: Initialize Repository")
92+ - setup user.name and user.email (see above)
93+ - create files, stage them and see what files are created in ` .git/objects `
94+ - commit files and check ` .git/objects `
95+ - create branches and checkout ` .git/refs ` (` git/branches ` is a legacy folder,see
96+ [ here] ( https://stackoverflow.com/a/10398507/9684872 ) )
97+ - look at ` git/HEAD ` (maybe ` git/ORIG_HEAD ` if it exists)
98+
99+ > try to create your own fork, and try to lauch it on [ mybinder] ( https://mybinder.org/ )
78100
79- ## Inspect git objects
101+ ### Inspect git objects
80102
81103``` bash
82104git log --format=raw
@@ -99,9 +121,24 @@ If you wonder what the codes in a tree mean, check this stackexchange
99121[ answer] ( https://unix.stackexchange.com/a/450488/349761 )
100122
101123
102- ## What's happening?
124+ ### What's happening?
125+
126+ Can you explain what happens in the following scenarios?
127+
128+ - You committed ten commits and did not yet push. Git complains about too much data.
129+ You realize that you committed your source data. You delete it and commit again,
130+ but the problem still persists.
131+ - You commit something and push. You realize your last commit was wrong. You undo it
132+ and commit again. Git complains that you cannot push.
133+
134+ ### Git internals resources
103135
104- - You commited ten commits and dit not yet push. Git complains about too much data.
105- You realize that you commited your source data. You delete it and commit again, but the problem still persists.
106- - You commit something and push. You realize your last commit was wrong. You undo it and commit again. Git complains that
107- you cannot push.
136+ - [ curious git] ( https://matthew-brett.github.io/curious-git/ ) - detailed intro to the
137+ inner workings
138+ - [ git parable] ( http://practical-neuroimaging.github.io/git_parable.html ) - why git came to exist
139+ - Videos:
140+ - [ Python-Git-Client] ( https://www.youtube.com/watch?v=xvzo_nV9PjU )
141+ - [ Git-Interals] ( https://www.youtube.com/watch?v=MYP56QJpDr4 ) - shows how git works
142+ - [ Git PyData Global 2021 talk] ( https://www.youtube.com/watch?v=rBYC3dEOOyI )
143+ - Scoot Chacon’s [ “So you thin you know git” talk] ( https://www.youtube.com/watch?v=aolI_Rz0ZqY ) (FOSDEM 2024),
144+ notes on [ blog] ( https://blog.gitbutler.com/git-tips-1-theres-a-git-config-for-that/ )
0 commit comments