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
  • fixes-typo-19
  • fixes-typo-2025-03-27
  • fixes-typo-2025-04-14
  • fixes-typo-2025u
  • fixes-typo-8
  • fixes-typo-9
  • krausec-main-patch-16624
  • lfs
  • main
  • wip/config-paste
  • wip/project-management
11 results

Target

Select target project
  • sc/edu/git-seminar
  • mk21womu/git-seminar
2 results
Select Git revision
  • fix/typo
  • lfs
  • master
  • wip/project-management
4 results
Show changes
Commits on Source (34)
Showing
with 995 additions and 209 deletions
......@@ -4,7 +4,13 @@ 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
......@@ -17,12 +17,22 @@ pandoc-papers.pdf: pandoc-papers.md
-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
......
This diff is collapsed.
......@@ -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"]
}
digraph {
node [shape = "box", style = "filled, rounded"]
master4[label = "Dirk (today)\nupdates methods chapter", color = limegreen]
master3[label = "Christian (yesterday)\nfixes typos", color = darkorchid1]
master2[label = "Dirk (three days ago)\nadds methods chapter", color = limegreen]
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 = "..."]
master2[label = "..."]
master1[label = "..."]
main3[label = "..."]
main2[label = "..."]
main1[label = "..."]
master3 -> master2 -> master1
main3 -> main2 -> main1
}
subgraph clusterplayground {
......@@ -24,5 +24,5 @@ digraph {
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"]
}
digraph {
compound = true
node [shape = "box", style = "filled, rounded"]
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_a[label = "v0.2.0"]
}
subgraph cluster_script {
label = "scripts"
node [color = lightskyblue]
script_version_a[label = "nature-v1"]
}
subgraph cluster_paper {
label = "paper"
node [color = limegreen]
paper_version_a[label = "nature-review-1"]
}
script_version_a -> software_a_version_a [label = "\n\n"]
script_version_a -> software_b_version_a [label = "\n\n"]
paper_version_a -> script_version_a [label = "\n\n"]
}
digraph {
compound = true
node [shape = "box", style = "filled, rounded"]
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"]
}
subgraph cluster_script {
label = "scripts"
node [color = lightskyblue]
script_version_b[label = "nature-v2"]
script_version_a[label = "nature-v1"]
}
subgraph cluster_paper {
label = "paper"
node [color = limegreen]
paper_version_a[label = "nature-review-1"]
paper_version_b[label = "nature-review-2"]
}
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"]
}
digraph {
compound = true
node [shape = "box", style = "filled, rounded"]
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"]
}
subgraph cluster_script {
label = "scripts"
node [color = lightskyblue]
script_version_b[label = "nature-v2"]
script_version_a[label = "nature-v1"]
}
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"]
}
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"]
}
digraph {
node [shape = "box", style = "filled,rounded"]
workdir[label = "working directory\n(changes not staged for commit)", color = lightskyblue]
stage[label = "staging area\n(changes to be committed)", color = orchid]
repo[label = "repository\n(tracked content)", color = limegreen]
workdir -> stage [label = "git diff"]
stage -> repo [label = "git diff --staged"]
}
img/unlimited-power.jpg

54.9 KiB

Subproject commit 2346a002289757ee612bfd4b56b57db53e0c751b
......@@ -10,7 +10,7 @@ intro
## motivation #1
![](img/draft_mess_half_size.png)
![](img/motivation-draft-mess-half-size.png)
## motivation #2
......
<!DOCTYPE html>
<html>
<head>
<title>git@rdm</title>
<link rel="stylesheet" href="reveal.js/dist/reveal.css">
<link rel="stylesheet" href="reveal.js/dist/theme/black.css">
<link rel="stylesheet" href="css/company-logo.css" />
<link rel="stylesheet" href="css/ribbon.css" />
<link rel="stylesheet" href="css/crawl.css" />
</head>
<body>
<div class="reveal">
<div class="slides">
<!---------------------------------------------------------------------
<!-- intro
<!-------------------------------------------------------------------->
<section>
<section id="title" data-markdown>
# git and rdm
## (... and reproducibility)
notes:
- `make -B` to create images, then reload
</section>
<section id="intro-objectives" data-markdown>
## objectives
- show how git relates to RDM
- ... and reproducibility
</section>
<section id="intro-agenda" data-markdown>
## agenda
1. motivation
1. ~~teach ***how*** to use git/GitHub/GitLab~~
1. use cases
1. anti-patterns
1. platforms
1. Q & A
notes:
- feel free to interrupt with immediate questions
- more involved detailed discussion as part of Q & A
</section>
<section id="intro-version-control" data-markdown>
## about version control
> records changes
what who when (why)
notes:
- the **why** (aka context) is optional
- you have to do this
- you have to care about it
</section>
<section id="intro-about-git" data-markdown>
## about git
### best tool for the job
- simple by design
- powerful if needed
- documentation / community
- industry standard
notes:
- git name: "the stupid content tracker"
- doc: finding answers with web searches
</section>
<section id="intro-about-me" data-markdown>
## about me
- scientific computing support @ iDiv since 2014
- satisfied git user since 2010
> There will never be a better version control system than git.
>
> -- Christian Krause, 2017
</section>
<section id="intro-about-you" data-markdown>
## about you
![people](img/people.jpg)
notes:
- who has never used any VCS before?
- who actively maintains a VCS repository?
</section>
</section>
<!---------------------------------------------------------------------
<!-- motivation
<!-------------------------------------------------------------------->
<section>
<section id="motivation" data-markdown>
# motivation
> Why should I use version control?
notes:
- motivation chapter is about the concept of version control
- git is just a tool to do it
</section>
<section id="motivation-avoid-mess" data-markdown>
## motivation #1
### avoid mess
![blah](img/motivation-draft-mess.png)
notes:
- who has seen such a mess?
- who has contributed to such a mess?
- who has created such a mess?
</section>
<section id="motivation-want-structure" data-markdown>
## motivation #1
### want structure
![blah](img/motivation-structure.svg)
notes:
- structure: who, when
- why is hidden (only shows message header, not body)
- ability to inspect old versions and their diff
- ability to revert/undo a change
</section>
<section id="motivation-playground" data-markdown>
## motivation #2
### throw-away playgrounds
![playground](img/motivation-throwaway-playground.svg)
notes:
- test stuff without interfering
- throw away if garbage
- integrate if good
- switch back and forth without pain
</section>
<section id="motivation-collaboration-1" data-markdown>
## motivation #c
### collaboration made easy
<!-- do not fix this typo, it is here on purpose to show collab -->
> This text cntains a typo.
notes:
- demo GitLab (change **target branch** to create merge request)
- this is how you can do reviews of drafts
- discuss this slide/chapter/section link
</section>
<section id="motivation-collaboration-2" data-markdown>
## motivation #c
![typo-pr](https://pbs.twimg.com/media/EDsklbLUEAMdusJ.png)
notes:
- might not seem like much
- but you are still making the world a better place
- and it is not too much effort
</section>
<section id="motivation-automation" data-markdown>
## motivation #a
### automation
- ***quality***
- **code analysis**
- **spell check**
- **software testing**
- enforce **style guide**
- ***deployment*** (app store, web server)
notes:
- basically, everything you can script
- refresh presentation before next slide
</section>
<section class="star-wars" id="motivation-wars">
<div class="crawl">
<div class="title">
<h1>motivation #wars</h1>
</div>
<div data-markdown>
1. view the ***history*** of changes
1. know ***why*** someone changed it
1. ***revert*** a bad change
1. maintain ***multiple versions***
1. see the ***diff*** of two versions
1. find commit ***that broke*** something
1. have free ***backup***
1. have ***non-interfering*** playgrounds
1. have ***automated*** testing
1. have ***automated*** deployment
1. ***contribute*** to a project
1. ***share*** your code
1. let other people do the work ***for you***
</div>
<img src="http://i.giphy.com/90F8aUepslB84.gif" />
</div>
</section>
</section>
<!---------------------------------------------------------------------
<!-- use cases
<!-------------------------------------------------------------------->
<section>
<section id="use-cases" data-markdown>
# use cases
##### for
### version control system (vcs)
##### aka
### source code management (scm)
</section>
<section id="use-case-software" data-markdown>
## software
- generic (as in parameterized)
- (ideally) tested
notes:
- e.g. R package
</section>
<section id="use-case-scripting" data-markdown>
## scripting
##### aka
### how to run `$software`
- ... in `$environment`
- digital lab notes
- **reproducibility** !!1!
- execution scalability
notes:
- separate software from scripting
- `$enviroment`: multiple scripts/configurations for different
environments:
- EasyBuild, conda, singularity
- RStudio server, HPC cluster
- execution scalability: running software or script without having
to change it
- keep failed attempts in branches
- e.g. highly parameterized software, make a record of bad
parameter sets
</section>
<section id="use-case-publishing" data-markdown>
# publishing
### (markdown (with some tex))
- paper / thesis / book
- presentation
- documentation
- blog
notes:
- who is using markdown?
- who is using tex?
- who is using word? why?
- markdown with tex
- git.idiv.de/help
- search for markdown
- search for math
- show example
</section>
<section id="use-case-integrated-1" data-markdown>
## integration
![run `make` to generate the image](img/rdm-use-cases-a.svg)
notes:
- software A: tried and tested, reference to compare to
- software B: your experimental better version
</section>
<section id="use-case-integrated-2" data-markdown>
## integration
![run `make` to generate the image](img/rdm-use-cases-b.svg)
</section>
<section id="use-case-integrated-3" data-markdown>
## integration
![run `make` to generate the image](img/rdm-use-cases.svg)
</section>
<section id="use-case-integrated-data" data-markdown>
## integration
![run `make` to generate the image](img/rdm-use-case-data.svg)
</section>
</section>
<!---------------------------------------------------------------------
<!-- anti patterns
<!-------------------------------------------------------------------->
<section>
<section id="anti-patterns" data-markdown>
# anti-patterns
![unlimited power](img/unlimited-power.jpg)
notes:
- does anyone know what an anti-pattern is?
</section>
<section id="anti-patterns-def" data-markdown>
# anti-patterns
> An anti-pattern is a common response to a recurring problem that
is usually ineffective and risks being highly counterproductive.
notes:
- most anti-patterns about how to use git
- focus here is on these relating to RDM and reproducibility
</section>
<section id="anti-pattern-binary" data-markdown>
# binary files
### (aka non-text)
- no diff with binary
- use textual representation
- convert with automation
notes:
- can someone give me an example of text file?
- markdown
- source code, scripts (R, shell)
- XSV
- can someone give me an example of binary file?
- compiled programs
- MS word excel
- PDF PS
- don't just put everything in the repo, use *ignore
</section>
<section id="anti-pattern-big-data" data-markdown>
# data in git
## (scientific/big data)
- version control for data is **DIFF**erent !!1!
- git is VCS for text, not for data
notes:
- do you release data with every script change? no, too expensive
- you don't ever put data files in a git repository
- not even with LFS
- big ball of mud, no metadata
</section>
</section>
<!---------------------------------------------------------------------
<!-- platforms
<!-------------------------------------------------------------------->
<section>
<section id="platforms-list" data-markdown>
# platforms
- GitHub
- https://github.com/idiv-biodiversity (cloud)
- GitLab
- https://gitlab.com (cloud)
- https://git.idiv.de (self-hosted @ iDiv)
</section>
<section id="platforms-purpose" data-markdown>
# platforms
- enable collaboration
- bug tracker / feature requests
- documentation / wiki
- project management tools
- issue boards, milestones, gantt
- trigger automation
- publish/download releases
</section>
</section>
<!---------------------------------------------------------------------
<!-- q & a
<!-------------------------------------------------------------------->
<section>
<section id="q-n-a" data-markdown>
# Q & A
notes:
- walk through examples of software/script/publishing
- walk through one of your use cases
- demo consulting
</section>
<section id="consulting" data-markdown>
# consulting
[christian.krause@idiv.de](mailto:christian.krause@idiv.de)
</section>
</section>
<!---------------------------------------------------------------------
<!-- eof
<!-------------------------------------------------------------------->
<section id="eof" data-background="img/trex.png" data-markdown>
### thanks for listening
# EOF
</section>
<!---------------------------------------------------------------------
<!-- backup
<!-------------------------------------------------------------------->
<section>
<section id="backup" data-markdown>
# backup slides
</section>
<section id="empty" data-markdown>
</section>
</section>
</div>
</div>
<!-------------------------------------------------------------------------
<!-- css/js
<!------------------------------------------------------------------------>
<!-- company logo -->
<div class="logo-wrapper">
<a href="https://www.idiv.de/">
<img src="img/company-logo-small.png" />
</a>
</div>
<!-- ribbon -->
<div class="ribbon-wrapper right">
<div class="ribbon">
<a href="https://git.idiv.de/sc/edu/git-seminar/edit/main/rdm.html"
target="_blank">
edit
</a>
</div>
</div>
<!-- reveal.stuff -->
<script src="reveal.js/dist/reveal.js"></script>
<script src="reveal.js/plugin/highlight/highlight.js"></script>
<script src="reveal.js/plugin/markdown/markdown.js"></script>
<script src="reveal.js/plugin/notes/notes.js"></script>
<script>
Reveal.initialize({
hash: true,
plugins: [RevealHighlight, RevealMarkdown, RevealNotes]
});
</script>
</body>
</html>