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 (109)
Showing with 718 additions and 802 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
# Introduction to git - a powerful version control system
## block structure
- Why git?
- poll from registration
- other points from our list
- git installation hands on
- git on the command line
- navigate manipulate on cli
- ls, pwd, cd, mv, rm, cp, mkdir, rmdir
- short break (optional)
- (like) try git on beamer (closed laptops)
- try git would be 1.1 to 1.9
- init
- status
- add
- commit
- log (metadata only)
- short break (optional)
- hands on - created project
- multiple commits
- multiple files
- diff
- log (with patch)
- wrap up hands on
- problems that occurred
- conclusion
## Why git?
### Why would you want to use a VCS, e.g. git?
- Summary of answers to question from registration.
- git helps you to keep an overview of a project.
### Thoughts from the net “Have you ever:”
- Made a change to code, realised it was a mistake and wanted to revert back?
- Lost code or had a backup that was too old?
- Had to maintain multiple versions of a product?
- Wanted to see the difference between two (or more) versions of your code?
- Wanted to prove that a particular change broke or fixed a piece of code?
- Wanted to review the history of some code?
- Wanted to submit a change to someone else's code?
- Wanted to share your code, or let other people work on your code?
- Wanted to see how much work is being done, and where, when and by whom?
- Wanted to experiment with a new feature without interfering with working code?
In these cases, and no doubt others, a version control system should make your life easier.
To misquote a friend: A civilised tool for a civilised age.
by si618 at [https://stackoverflow.com/a/1408464](https://stackoverflow.com/a/1408464)
## git installation hands on
[instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
### installation on ubuntu
We will use the version from the git ppa:
```bash
sudo apt-get install ppa-purge
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install git
```
### installation on windows
- [Download](https://git-scm.com/download/win)
- choose 64 bit
- portable if you do not have admin rights
- default install options look OK
- Git Bash
- Windows Explorer context menue has *Git Bash Here* and *Git GUI Here* options
- Windows credential window will pop up when accessing remotes with authentication
### navigate and manipulate on cli
- pwd
- ls
- cd
- mv
- rm
- cp
- mkdir
- rmdir
### configure git
```bash
git config --global user.name "Your Name"
git config --global user.email "your.name@idiv.de"
```
- eventually additionally configuration for windows/linux/mac stuff
- line break configuration done during install for windows
- eventually mention difference global local
## short break (optional)
## show try git like tutorial on beamer (closed laptops)
- try git would be 1.1 to 1.9
- create project directory
- init
- status
- add
- commit
- log (metadata only)
## short break (optional)
## hands on - created project
- multiple commits
- multiple files
- diff
- log (with patch)
- test this with a windows and mac machine to see things like editor, linebreaks, etc.
## wrap up hands on
- problems that occurred
- conclusion
......@@ -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
......
# The Official iDiv git Seminar
# The Official iDiv git Seminars
## Usage
- update reveal.js submodule
- run make to create svg from dot sources
To view the presentations locally, you need to clone the repository
recursively, to also get a copy of [reveal.js][]:
```bash
git clone --recursive https://git.idiv.de/sc/edu/git-seminar.git
```
Then you also need to create the images from the [graphviz dot
sources][graphviz]:
```bash
cd git-seminar
make
```
Then you can view the presentations, e.g. the basics:
```
firefox basics.html
```
## Attribution
- git logo by [Jason Long](https://twitter.com/jasonlong)
[graphviz]: http://www.graphviz.org/
[reveal.js]: https://revealjs.com/#/
# 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.
.star-wars {
height: 800px;
perspective: 400px;
color: #feda4a;
letter-spacing: 6px;
}
.crawl {
position: relative;
animation: crawl 120s linear;
}
.crawl > .title > h1 {
color: #feda4a;
}
@keyframes crawl {
0% {
top: 0;
transform: rotateX(20deg) translateZ(0);
}
100% {
top: -6000px;
transform: rotateX(25deg) translateZ(-2500px);
}
}
......@@ -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/gitk-pretty-history.png

44.3 KiB | W: | H:

img/gitk-pretty-history.png

63.4 KiB | W: | H:

img/gitk-pretty-history.png
img/gitk-pretty-history.png
img/gitk-pretty-history.png
img/gitk-pretty-history.png
  • 2-up
  • Swipe
  • Onion skin
img/idiv-black-logo.png

10.1 KiB

img/idiv-black.png

34.9 KiB

File moved