Skip to content

Commit 9a6f7a3

Browse files
committed
Add final changes for GIT to notes and slides
1 parent d5bd906 commit 9a6f7a3

File tree

3 files changed

+100
-32
lines changed

3 files changed

+100
-32
lines changed

Diff for: session1_git_and_workflow/notes.rst

+100-32
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Meta
66
- Links
77
- Make graphs: https://github.com/deuill/grawkit
88
- 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/
914

1015
- Prepare Laptop
1116
- slides
@@ -17,18 +22,24 @@ Meta
1722
- https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53
1823
- https://chris.beams.io/posts/git-commit/
1924

25+
- Travis-CI
26+
- https://travis-ci.org/lumbric/lunchbot/branches
27+
- https://github.com/lumbric/lunchbot
28+
2029
- Print for overhead projector:
2130
- Vocabulary
2231
- Basic workflow graph
2332
- Commands
2433
- cheat sheet
2534

35+
2636
Intro
2737
-----
2838

2939
- Introduce presenters
3040
- quick intro of 4 sessions
31-
- interrupt for questions today
41+
- interrupt for questions today & expect participation
42+
- quick survey: commands & terms
3243

3344
- Introduction
3445
- Screenshot of "final.doc"
@@ -41,6 +52,15 @@ Intro
4152
- it is not clear how to split work into single consistent steps
4253
- not clear and maybe no need how to describe these steps
4354

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+
4464
- Why?
4565
- GIT as solution for versioning files
4666
--> split work into steps (commits)
@@ -52,6 +72,9 @@ Intro
5272
- versions connected via tree-like graph, each node is a commit
5373
- GIT: think of commit as changes ("patches")
5474
- 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
5578
- How?
5679
- command line
5780
- GUIs, IDE integration
@@ -106,11 +129,17 @@ Intro
106129

107130
- Something went wrong...
108131
- 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)
111132
- git reflog
112133

113134

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+
114143
- Excercise: local repo
115144
- git init
116145
- git config --global user/mail
@@ -121,16 +150,20 @@ Intro
121150
- create a feature branch
122151
- create a commit
123152

124-
- Excercise
125-
- git rebase -i HEAD~7
153+
- Exercise:
154+
- clone some open source repository
126155

127156

128157
10:15: Remotes
129158
--------------
130159

131-
- Github
160+
- Remotes
132161
- Decentralized version control system
133162
- What is a remote?
163+
- http, ssh, filesystem...
164+
- ssh publickeys
165+
166+
- Github
134167
- git != Github
135168
- Alternatives: Gitlab, Bitbucket, your own server, local folder and many more
136169
- Github is your business card!
@@ -144,11 +177,31 @@ Intro
144177
- Wiki
145178
- Issue tracker
146179

147-
- Many things are undeletable
180+
- Warning: Many things are undeletable
148181
- Commits (only by changing Sha1)
149182
- Pull requests
150183
- Issues
151184

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+
152205
- forced push: rewriting history on the remote
153206
- rewrite history: rebase, git commit --amend
154207
- Golden rule: don't rewrite history after it leaves your machine
@@ -160,37 +213,60 @@ Intro
160213
- https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53
161214
- https://chris.beams.io/posts/git-commit/
162215

163-
- Live demo: pull request xarray: typo most -> must
164-
xarray/core/alignment.py
165-
166216
- Excercise: push to Github
167217
- Clone the workshop repo with --recursive!
168218
- 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!
169226

170227

171228
11:00 Large files and workflow
172229
------------------------------
173230

174-
- folder structure
175-
- no cyclic dependencies
176-
- README, LICENSE
177-
- packages: Make, setup.py
178-
179231
- Complete Workflow:
180232
- 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!
190255
- publish private data
191256
- 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
192260

193261
- 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
194270

195271

196272
11:45 How git works
@@ -217,14 +293,6 @@ Intro
217293
- HEAD
218294
- refs/heads
219295

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-
228296
- Fun with GIT
229297
- cycles in history?
230298
- GIT coin

Diff for: session1_git_and_workflow/slides-expanded.pdf

658 Bytes
Binary file not shown.

Diff for: session1_git_and_workflow/slides.pdf

647 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)