Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • sc/edu/git-seminar
  • mk21womu/git-seminar
2 results
Select Git revision
Show changes
Commits on Source (72)
Showing
with 524 additions and 654 deletions
......@@ -2,5 +2,15 @@ img/git-remote-contributor.svg
img/git-remote-maintainer.svg
img/git-remote-solo.svg
img/license-chooser.svg
img/motivation-structure.svg
img/motivation-throwaway-playground.svg
img/rdm-use-case-data.svg
img/rdm-use-cases-a.svg
img/rdm-use-cases-b.svg
img/rdm-use-cases.svg
img/staging-area.svg
paper.html
paper.pdf
*.pdf
img/staging-area-diff.svg
/img/rdm-use-case-merged.svg
[submodule "reveal.js"]
path = reveal.js
url = https://github.com/hakimel/reveal.js.git
[submodule "pandoc-cheat-sheet"]
path = pandoc-cheat-sheet
url = https://github.com/idiv-biodiversity/pandoc-cheat-sheet.git
......@@ -4,12 +4,35 @@ SUBDIRS = \
$(SUBDIRS):
$(MAKE) -C $@
pandoc-papers.pdf: pandoc-papers.md
pandoc \
-V aspectratio=169 \
-V institute=iDiv \
-V theme=Frankfurt \
-V navigation=horizontal \
-V logo=img/idiv-black-logo.png \
--pdf-engine=xelatex \
-s \
-t beamer \
-o pandoc-papers.pdf \
pandoc-papers.md
rdm.pdf: img rdm.md rdm.yml
pandoc \
--standalone \
--from=markdown+yaml_metadata_block \
--pdf-engine=xelatex \
--template=pandoc-cheat-sheet/cheat-sheet.tex \
-o rdm.pdf \
rdm.yml rdm.md
all: subdirs
clean:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@; \
done
rm -f rdm.pdf
default: all
......
# regular FAQ
- 10-12 git integration RStudio / VS Code / others
- 13-15 GitLab / GitHub project setup / importing existing projects / how to start and continue after that, project management, issue management
- 15-16 GitLab / GitHub automation
- 16-18 free for all
# git advanced -- how to maintain a comprehensible history
- when projects get bigger
- show bad example with merge commits
- show git-flow being harmful
- show git-pretty
Advanced git is not about edge use cases, it's all about keeping your history
comprehensible, i.e. understandable.
## trunk based development
- project history, e.g. via `gitk` or `git lol`, should resemble a **tree**
- for this section we're sticking to the tree metaphor
- long-lived branches basically **master** (and **releases**)
- long trunk of tree
- dead branches on lower trunk (old, unmaintained releases), which may also be
cut down in time if support is dropped
- only clean merges (could have been ff)
## final chapter
- consider like backup slides
- show goodies
## resources
- https://barro.github.io/2016/02/a-succesful-git-branching-model-considered-harmful/
- https://stackoverflow.com/questions/14023648/why-does-my-git-history-look-like-a-christmas-tree
- https://i.stack.imgur.com/ZsXT6.png
- https://trunkbaseddevelopment.com
This diff is collapsed.
......@@ -100,7 +100,7 @@
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="30,18.6171"/>
<dia:point val="30,18.6161"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......@@ -194,7 +194,7 @@
<dia:point val="33,15"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="32.8075,14.2525;33.1925,15"/>
<dia:rectangle val="32.8075,14.255;33.1925,15"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
......@@ -208,7 +208,7 @@
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="33,14.8475"/>
<dia:point val="33,14.8491"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......@@ -227,7 +227,7 @@
<dia:point val="38,15"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="37.8075,14.2525;38.1925,15"/>
<dia:rectangle val="37.8075,14.255;38.1925,15"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
......@@ -241,7 +241,7 @@
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="38,14.8475"/>
<dia:point val="38,14.8491"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......@@ -290,7 +290,7 @@
<dia:point val="33,5"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="30.8137,4.38631;35.2049,6.78988"/>
<dia:rectangle val="30.8137,4.40594;35.1863,6.75094"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
......@@ -343,7 +343,7 @@ git rebase b c#</dia:string>
<dia:point val="28,11"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="27.8075,10.2525;28.1925,11"/>
<dia:rectangle val="27.8075,10.255;28.1925,11"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
......@@ -357,7 +357,7 @@ git rebase b c#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="28,10.8475"/>
<dia:point val="28,10.8491"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......@@ -408,7 +408,7 @@ git rebase b c#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="51,12.195"/>
<dia:point val="51,12.1941"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......@@ -502,7 +502,7 @@ git rebase b c#</dia:string>
<dia:point val="56,15"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="55.8075,14.2525;56.1925,15"/>
<dia:rectangle val="55.8075,14.255;56.1925,15"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
......@@ -516,7 +516,7 @@ git rebase b c#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="56,14.8475"/>
<dia:point val="56,14.8491"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......@@ -535,7 +535,7 @@ git rebase b c#</dia:string>
<dia:point val="61,15"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="60.8075,14.2525;61.1925,15"/>
<dia:rectangle val="60.8075,14.255;61.1925,15"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
......@@ -549,7 +549,7 @@ git rebase b c#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="61,14.8475"/>
<dia:point val="61,14.8491"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......@@ -598,14 +598,14 @@ git rebase b c#</dia:string>
<dia:point val="56,5"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="52.9162,4.38631;59.1024,7.58988"/>
<dia:rectangle val="52.9175,4.38731;59.1011,7.58819"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
<dia:string>#cherry-pick
git checkout b
git switch b
git cherry-pick a...c#</dia:string>
</dia:attribute>
<dia:attribute name="font">
......@@ -652,7 +652,7 @@ git cherry-pick a...c#</dia:string>
<dia:point val="51,11"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="50.8075,10.2525;51.1925,11"/>
<dia:rectangle val="50.8075,10.255;51.1925,11"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
......@@ -666,7 +666,7 @@ git cherry-pick a...c#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="51,10.8475"/>
<dia:point val="51,10.8491"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="Christian Krause" />
<meta name="dcterms.date" content="2015-06-15" />
<title>Git Workshop</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="reveal.js/css/reveal.css"/>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" href="reveal.js/css/theme/black.css" id="theme" />
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'reveal.js/css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
<!--[if lt IE 9]>
<script src="reveal.js/lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1 class="title">Git Workshop</h1>
<h3 class="author">Dirk Sarpe & Christian Krause</h3>
<aside class="notes">
<ul>
<li>if you have questions ask them right away</li>
</ul>
</aside>
</section>
<section id="poll-why-are-you-here" class="titleslide slide level1" data-markdown>
## Poll
# Why are you here?
Note:
- Someone (like us) told you it ~~might be~~ **is** useful.
- You never took the time to really learn it.
- You already know and use it, want to show off / learn new tricks.
- Somebody forced you to come here.
- You wanted to get away from your desk for once and maybe take a nap.
</section>
<section id="outline" class="titleslide slide level1" data-markdown>
# Outline
1. Intro
2. Git Commands
3. GitLab / GitHub
4. Workflows
Note:
- jeder Block ~ 1.5h
- insgesamt 2h mit Pause
- 8h - ein ganzer Tag git
- ein-satz-beschreibungen zu den abschnitten
- 0. why vcs, why git, getting started with git
- 1. git basics
- 2. web collaboration tools
- 3. how to collaborate in organized manner
</section>
<section>
<section class="titleslide slide level1" data-markdown>
## Block 1
# Introduction
Note:
- quickly talk about block outline
- why vcs? why git?
- installation git client
- setup GitLab / GitHub accounts
- getting started with git (try git)
</section>
<section class="slide level2" data-markdown>
### Have you ever seen this?
![foo](img/draft_mess.png)
Note:
- Dirk erklärt seine mess
- wouldn't it be nicer to have
</section>
<section class="slide level2" data-markdown>
### wouldn't it be nicer to have
# version control
```
Dirk Sarpe 14 minutes ago fix reference
Dirk Sarpe 5 days ago adapt figures to nature
Christian Krause 6 days ago add figure captions
Dirk Sarpe 7 weeks ago adds mean values to analysis
Christian Krause 7 weeks ago adds abstract
```
Note:
- git log --pretty=format'%an %ar %s'
- and as you can see not only for source code
</section>
<section class="slide level2" data-markdown>
## have you ever ...
- review history (see diff)
- wanted to go back in time
- maintain multiple versions
- hint: for different journals
- try things out without breaking what works
Note:
-
</section>
<section class="slide level2" data-markdown>
## have you ever ...
- collaborate
- who made that error
- see project progress
- lost code (no backup)
Note:
-
</section>
<section class="slide level2" data-markdown>
# yes?
Note:
-
</section>
<section class="slide level2" data-markdown>
# use vcs!
Note:
-
</section>
</section>
<section>
<section class="titleslide slide level1" data-markdown>
## Block 1
# git
Note:
-
</section>
<section class="titleslide slide level1" data-markdown>
![git](img/what-is-git.jpg)
Note:
-
</section>
<section class="titleslide slide level1" data-markdown>
![git](img/what-is-git-answer.jpg)
Note:
-
</section>
<section class="titleslide slide level1" data-markdown>
![git](img/say-what.jpg)
Note:
-
</section>
<section class="titleslide slide level1" data-markdown>
## what is git? (2nd try)
### seriously
# TODO image gitk all, visual representation of git parent child tree with remotes,
tags, good commit messages, etc. mit local change der remote noch nicht da ist
Note:
- am bild dvcs erklären!
</section>
<section class="slide level2" data-markdown>
![git](img/idontalwaysusevcs.jpg)
Note:
-
</section>
<section class="slide level2" data-markdown>
## Why do we all use git?
#### non-technical
- any workflow
- collaboration
- experimentation
- undo mistakes
- state of the art (best tool for the job)
- all the cool kids do it
Note:
-
</section>
<section class="slide level2" data-markdown>
## Why do we all use git?
#### technical
- never lose data (not just remote but also file integrity)
- easy conflict resolution
- local (your own copy of everything)
- implies speedy gonzales
Note:
-
</section>
</section>
</section>
<section>
<section id="prereq" class="titleslide slide level1" data-markdown>
### Block 1
## Git Demo
Note:
- vorher fragen, wer alles client braucht und noch accounts braucht, damit wir wissen,
wieviel zeit wir uns für try git nehmen können
- config
- init
- git add foo bar
- git commit -m 'foo bar'
- prima
</section>
</section>
<section>
<section id="prereq" class="titleslide slide level1" data-markdown>
### Block 1
## Checking Prerequisites
- GitHub / GitLab account
- local git client installation
- bonus: your own project without VCS
Note:
- wenn git client selbst nicht aufsetzen kann, dann bitte halbe stunde früher
- registration to the course
- git client includes your own notebook
</section>
</section>
<section class="slide level2" data-markdown>
##
-
Note:
-
</section>
</section>
<section>
<section class="titleslide slide level1" data-markdown>
# VCS for me
-
Note:
-
</section>
<section class="slide level2" data-markdown>
##
-
Note:
-
</section>
</section>
<section>
<section class="titleslide slide level1" data-markdown>
#
-
Note:
-
</section>
<section class="slide level2" data-markdown>
##
-
Note:
-
</section>
</section>
<section id="eof" data-background="img/trex.png"><h1>EOF</h1></section>
</div>
</div>
<script src="reveal.js/lib/js/head.min.js"></script>
<script src="reveal.js/js/reveal.js"></script>
<script>
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
maxScale: 1.5,
slideNumber: false,
theme: Reveal.getQueryHash().theme,
transition: Reveal.getQueryHash().transition || 'default',
dependencies: [
{ src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'reveal.js/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'reveal.js/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
]
});
</script>
</body>
</html>
handouts/git-pretty.png

675 KiB

img/git-merge-is-bad.png

307 KiB

......@@ -6,7 +6,7 @@ digraph {
node [color = orchid]
omaster[label = "master"]
omain[label = "main"]
}
subgraph clusterlocal {
......@@ -14,7 +14,7 @@ digraph {
node [color = orchid]
master[label = "master"]
main[label = "main"]
}
subgraph clusterupstream {
......@@ -22,11 +22,11 @@ digraph {
node [color = limegreen]
umaster[label = "master"]
umain[label = "main"]
}
omaster -> master [label = "git pull"]
master -> omaster [label = "git push", constraint = false]
umaster -> master [label = "git pull upstream master", constraint = false]
omaster -> umaster [label = "pull request (GitHub)\nmerge request (GitLab)", constraint = false]
omain -> main [label = "git pull"]
main -> omain [label = "git push", constraint = false]
umain -> main [label = "git pull upstream main", constraint = false]
omain -> umain [label = "pull request (GitHub)\nmerge request (GitLab)", constraint = false]
}
......@@ -6,7 +6,7 @@ digraph {
node [color = orchid]
omaster[label = "master"]
omain[label = "main"]
}
subgraph clusterlocal {
......@@ -14,7 +14,7 @@ digraph {
node [color = orchid]
master[label = "master"]
main[label = "main"]
}
subgraph clusteralice {
......@@ -22,7 +22,7 @@ digraph {
node [color = limegreen]
amaster[label = "master"]
amain[label = "main"]
}
subgraph clusterbob {
......@@ -30,11 +30,11 @@ digraph {
node [color = lightskyblue]
bmaster[label = "master"]
bmain[label = "main"]
}
omaster -> master [label = "git pull"]
master -> omaster [label = "git push", constraint = false]
amaster -> master [label = "git pull alice", constraint = false]
bmaster -> master [label = "git pull bob", constraint = false]
omain -> main [label = "git pull"]
main -> omain [label = "git push", constraint = false]
amain -> main [label = "git pull alice", constraint = false]
bmain -> main [label = "git pull bob", constraint = false]
}
......@@ -9,7 +9,7 @@ digraph {
node [color = orchid]
omaster[label = "master"]
omain[label = "main"]
}
subgraph clusterlocal {
......@@ -17,10 +17,10 @@ digraph {
node [color = orchid]
master[label = "master"]
main[label = "main"]
}
omaster -> master [label = "git fetch", style = dotted, ltail = clusterorigin, lhead = clusterlocal]
master -> omaster [label = "git push"]
omaster -> master [label = "git pull"]
omain -> main [label = "git fetch", style = dotted, ltail = clusterorigin, lhead = clusterlocal]
main -> omain [label = "git push"]
omain -> main [label = "git pull"]
}
img/idiv-black-logo.png

10.1 KiB

img/idiv-black.png

34.9 KiB

File moved
digraph {
node [shape = "box", style = "filled, rounded"]
master4[label = "Alice (today)\nfixes logic error", color = limegreen]
master3[label = "Bob (yesterday)\nfixes typos", color = darkorchid1]
master2[label = "Alice (three days ago)\nadds methods chapter", color = limegreen]
master1[label = "...", color = grey]
master4 -> master3 -> master2 -> master1
}
digraph {
node [shape = "box", style = "filled, rounded"]
subgraph clustermaster {
label = "master"
subgraph clustermain {
label = "main"
node [color = limegreen]
master3[label = "ebe0262"]
master2[label = "03f4f8d"]
master1[label = "62a0ee9"]
main3[label = "..."]
main2[label = "..."]
main1[label = "..."]
master3 -> master2 -> master1
main3 -> main2 -> main1
}
subgraph clusterplayground {
......@@ -18,11 +18,11 @@ digraph {
node [color = orchid]
playground2[label = "8b29f74"]
playground1[label = "7f295dd"]
playground2[label = "visualization"]
playground1[label = "methods"]
playground2 -> playground1
}
playground1 -> master2
playground1 -> main2
}
digraph {
compound = true
node [shape = "box", style = "filled, rounded"]
subgraph cluster_script {
label = "scripts"
node [color = lightskyblue]
script_version_b[label = "nature-v2"]
}
subgraph cluster_data {
label = "data repository (not git!)"
node [color = limegreen]
data_version_a[label = "doi:blah/blah"]
}
subgraph cluster_paper {
label = "paper"
node [color = limegreen]
paper_version_c[label = "nature-final"]
}
paper_version_c -> data_version_a [label = "\n\n", lhead = cluster_data]
data_version_a -> script_version_b [label = "\n\n", lhead = cluster_script]
}
digraph {
compound = true
node [shape = "box", style = "filled, rounded"]
subgraph cluster_script {
label = "scripts"
node [color = lightskyblue]
script_version_b[label = "nature-v2"]
script_version_a[label = "nature-v1"]
}
subgraph cluster_data {
label = "data repository (not git!)"
node [color = limegreen]
data_version_a[label = "doi:blah/blah"]
}
subgraph cluster_paper {
label = "paper"
node [color = limegreen]
paper_version_a[label = "nature-review-1"]
paper_version_b[label = "nature-review-2"]
paper_version_c[label = "nature-final"]
}
subgraph cluster_software_a {
label = "software A"
node [color = orchid]
software_a_version_a[label = "v2.1.6"]
}
subgraph cluster_software_b {
label = "software B"
node [color = orchid]
software_b_version_b[label = "v0.3.4"]
software_b_version_a[label = "v0.2.0"]
}
script_version_a -> software_a_version_a [label = "\n\n"]
script_version_b -> software_a_version_a [label = "\n\n"]
script_version_a -> software_b_version_a [label = "\n\n"]
script_version_b -> software_b_version_b [label = "\n\n"]
paper_version_a -> script_version_a [label = "\n\n"]
paper_version_b -> script_version_b [label = "\n\n"]
paper_version_c -> script_version_b [label = "\n\n"]
paper_version_c -> data_version_a [label = "\n\n"]
data_version_a -> script_version_b [label = "\n\n"]
}