6
6
- Links
7
7
- Make graphs: https://github.com/deuill/grawkit
8
8
- Slides: https://www.slideshare.net/ThomasRausch4/git-introduction-tutorial
9
+ - How to teach GIT:
10
+ - https://recompilermag.com/issues/issue-0/bad-metaphors/
11
+ - https://recompilermag.com/issues/issue-1/how-to-teach-git/
12
+ - https://software-carpentry.org/blog/2012/12/some-of-the-things-weve-learned-about-teaching-git.html
13
+ - https://jordankasper.com/lessons-learned-teaching-git/
9
14
10
15
- Prepare Laptop
11
16
- slides
17
22
- https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53
18
23
- https://chris.beams.io/posts/git-commit/
19
24
25
+ - Travis-CI
26
+ - https://travis-ci.org/lumbric/lunchbot/branches
27
+ - https://github.com/lumbric/lunchbot
28
+
20
29
- Print for overhead projector:
21
30
- Vocabulary
22
31
- Basic workflow graph
23
32
- Commands
24
33
- cheat sheet
25
34
35
+
26
36
Intro
27
37
-----
28
38
29
39
- Introduce presenters
30
40
- quick intro of 4 sessions
31
- - interrupt for questions today
41
+ - interrupt for questions today & expect participation
42
+ - quick survey: commands & terms
32
43
33
44
- Introduction
34
45
- Screenshot of "final.doc"
41
52
- it is not clear how to split work into single consistent steps
42
53
- not clear and maybe no need how to describe these steps
43
54
55
+ - What is a version control system and why do I need it?
56
+ - protects yourself and others from yourself and others (backup)
57
+ - collaboration: work on the same project in a team without need of complicated architecture
58
+ - don't afraid change: reverting is easy
59
+ - mark which parts are working and which are broken (stable branch, commits under review etc)
60
+ - review: split work into readable and consistent parts
61
+ - apply a fix to multiple maintained branches
62
+ - develop 5 features and deploy them in arbitrary order to the production system
63
+
44
64
- Why?
45
65
- GIT as solution for versioning files
46
66
--> split work into steps (commits)
52
72
- versions connected via tree-like graph, each node is a commit
53
73
- GIT: think of commit as changes ("patches")
54
74
- Operations: branch, rebase, cherry-pick, sending commits (push/pull)
75
+ - difference 1 to copying folders: connections (history)
76
+ - difference 2 to copying folders: operations
77
+ - difference 3 to copying folders: smaller file size
55
78
- How?
56
79
- command line
57
80
- GUIs, IDE integration
@@ -106,11 +129,17 @@ Intro
106
129
107
130
- Something went wrong...
108
131
- https://ohshitgit.com/
109
- - revert a file in the working tree to the last committed one
110
- - edit the last commit (before pushing to remote)
111
132
- git reflog
112
133
113
134
135
+ - Some hints:
136
+ - don't leave comments in the code!
137
+ - for command line, use a good command completion!
138
+ - you want to have a tree viewer (terminal or GUI)
139
+ - many commands can be aborted, like git rebase --abort
140
+ - git add again after changing a file
141
+
142
+
114
143
- Excercise: local repo
115
144
- git init
116
145
- git config --global user/mail
@@ -121,16 +150,20 @@ Intro
121
150
- create a feature branch
122
151
- create a commit
123
152
124
- - Excercise
125
- - git rebase -i HEAD~7
153
+ - Exercise:
154
+ - clone some open source repository
126
155
127
156
128
157
10:15: Remotes
129
158
--------------
130
159
131
- - Github
160
+ - Remotes
132
161
- Decentralized version control system
133
162
- What is a remote?
163
+ - http, ssh, filesystem...
164
+ - ssh publickeys
165
+
166
+ - Github
134
167
- git != Github
135
168
- Alternatives: Gitlab, Bitbucket, your own server, local folder and many more
136
169
- Github is your business card!
@@ -144,11 +177,31 @@ Intro
144
177
- Wiki
145
178
- Issue tracker
146
179
147
- - Many things are undeletable
180
+ - Warning: Many things are undeletable
148
181
- Commits (only by changing Sha1)
149
182
- Pull requests
150
183
- Issues
151
184
185
+ - Live demo: pull request xarray: typo most -> must
186
+ xarray/core/alignment.py
187
+
188
+ - Fix things, rewrite history:
189
+ - commit --ammend
190
+ - checkout
191
+ - reset, reset --hard
192
+ - git rebase -i HEAD~7
193
+ - reflog
194
+ - revert: not!
195
+ - https://ohshitgit.com/
196
+
197
+ - rewriting history?
198
+ - commit
199
+ - rebase
200
+ - cherry-pick
201
+ - fetch
202
+ - pull
203
+ - push
204
+
152
205
- forced push: rewriting history on the remote
153
206
- rewrite history: rebase, git commit --amend
154
207
- Golden rule: don't rewrite history after it leaves your machine
@@ -160,37 +213,60 @@ Intro
160
213
- https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53
161
214
- https://chris.beams.io/posts/git-commit/
162
215
163
- - Live demo: pull request xarray: typo most -> must
164
- xarray/core/alignment.py
165
-
166
216
- Excercise: push to Github
167
217
- Clone the workshop repo with --recursive!
168
218
- git-game
219
+ - run as many commands as possible!
220
+
221
+ - Exercise:
222
+ - create a repository (on github)
223
+ - work in it (commit)
224
+ - somebody else breaks master (evil commit)
225
+ - continue working and rebase your work afterwards!
169
226
170
227
171
228
11:00 Large files and workflow
172
229
------------------------------
173
230
174
- - folder structure
175
- - no cyclic dependencies
176
- - README, LICENSE
177
- - packages: Make, setup.py
178
-
179
231
- Complete Workflow:
180
232
- Imagine there are 3-8 developers with an idea
181
- - start sitting together and roughly agree on some goals, (project) names,
182
- workflow, review
183
- - how does a repository look like?
184
- - somebody creates one or more repositories and the initial file/folder
185
- structure
186
- - Build server: tests & packages
187
-
188
- - what could go wrong: nothing! (reflog)
189
- - merge conflict
233
+ - start sitting together and roughly agree on some goals, (project) names, workflow, review
234
+
235
+ - folder structure
236
+ - no cyclic dependencies
237
+ - README, LICENSE
238
+ - packages: Make, setup.py
239
+ - how does a repository look like?
240
+ - https://github.com/numpy/numpy/
241
+
242
+ - somebody creates one or more repositories and the initial file/folder structure
243
+ - split work in tasks, go agile? :)
244
+ - different ways:
245
+ - every body pushes to master, maybe tags from time to time
246
+ - feature branches & pull request, somebody approves and merges
247
+
248
+ - Build server: e.g. Travis CI
249
+ - build packages & run tests (and other tasks?)
250
+ - https://travis-ci.org/lumbric/lunchbot/branches
251
+ - https://github.com/lumbric/lunchbot
252
+
253
+
254
+ - what could go wrong: nothing!
190
255
- publish private data
191
256
- Github: issues, wiki are not deletable
257
+ - merge conflicts might be complicated and surprising
258
+ - start something and end in a weird state (e.g. git rebase)
259
+ --> ohshitgit
192
260
193
261
- GIT large files
262
+ - git lfs
263
+ - DVC
264
+ - ...?
265
+
266
+ What you cannot do with GIT:
267
+ - large files (Github: 100MB, everything is stored forever)
268
+ - mixing public and private branches in one repository, cloning repos partially
269
+ - Jupyter notebooks: nbdime
194
270
195
271
196
272
11:45 How git works
@@ -217,14 +293,6 @@ Intro
217
293
- HEAD
218
294
- refs/heads
219
295
220
- What you cannot do with GIT:
221
- - large files (Github: 100MB, everything is stored forever)
222
- - mixing public and private branches in one repository, cloning repos partially
223
- - Jupyter notebooks
224
-
225
- - Branching models
226
- - feature branches
227
-
228
296
- Fun with GIT
229
297
- cycles in history?
230
298
- GIT coin
0 commit comments