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 (154)
reveal.js
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
## Why would you want to use a VCS?
### 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)
### Does this look familiar?
Picture with many draft versions.
Punchline: Not only for code.
### A VCS gives you a history of your project:
* dcad3f8 add table captions for fwb
* 92531e7 figure captions for fwb
* 5129bdd adapted figure to fig for fwb and minor
* fff1924 minor: fix reference name
* dda1e33 adapt abstract to numbered fwb summary
* d2f46d3 compare real TCI and our TCI
* 35787b1 some mean values we need to report
* 6af0b79 denser conclusion
This diff is collapsed.
SUBDIRS = \
img
$(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
subdirs: $(SUBDIRS)
.PHONY: \
$(SUBDIRS) \
all \
clean \
default \
subdirs
# The Official iDiv git Seminars
## Usage
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.
.logo-wrapper {
position: fixed;
top: inherit;
top: 0;
z-index: 9999;
padding: 10px 10px;
}
.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);
}
}
/* Left will inherit from right (so we don't need to duplicate code */
.ribbon {
/* The right and left lasses determine the side we attach our banner to */
position: absolute;
/* Add a bit of padding to give some substance outside the "stitching" */
padding: 2px 0;
/* Set the base colour */
background-color: #a00;
/* Set a gradient: transparent black at the top to almost-transparent black at the bottom */
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.00)), to(rgba(0, 0, 0, 0.15)));
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.00), rgba(0, 0, 0, 0.15));
background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0.00), rgba(0, 0, 0, 0.15));
background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0.00), rgba(0, 0, 0, 0.15));
background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0.00), rgba(0, 0, 0, 0.15));
background-image: linear-gradient(top, rgba(0, 0, 0, 0.00), rgba(0, 0, 0, 0.15));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#000000', EndColorStr='#000000');
/* Add a drop shadow */
-webkit-box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.5);
box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.5);
z-index: 9999;
}
.ribbon a,
.ribbon a:hover {
/* Set the font */
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
font-weight: 700;
color: white;
/* Set the text properties */
text-decoration: none;
text-shadow: 0 -1px rgba(0,0,0,0.5);
text-align: center;
/* Set the geometry. If you fiddle with these you'll also need to tweak the top and right values in #ribbon. */
width: 200px;
line-height: 20px;
/* Set the layout properties */
display: inline-block;
padding: 2px 0;
/* Add "stitching" effect */
border-width: 1px 0;
border-style: dotted;
border-color: rgba(255,255,255,0.7);
}
.ribbon-wrapper {
width: 150px;
height: 150px;
position: absolute;
overflow: hidden;
top: 0;
z-index: 9999;
}
.ribbon-wrapper.fixed {
position: fixed;
}
.ribbon-wrapper.left {
left: 0;
}
.ribbon-wrapper.right {
right: 0;
}
.ribbon-wrapper.left-bottom {
position: fixed;
top: inherit;
bottom: 0;
left: 0;
}
.ribbon-wrapper.right-bottom {
position: fixed;
top: inherit;
bottom: 0;
right: 0;
}
.ribbon-wrapper.right .ribbon {
top: 42px;
right: -43px;
/* Rotate the banner 45 degrees */
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.ribbon-wrapper.left .ribbon {
top: 42px;
left: -43px;
/* Rotate the banner -45 degrees */
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.ribbon-wrapper.left-bottom .ribbon {
top: 80px;
left: -43px;
/* Rotate the banner -45 degrees */
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.ribbon-wrapper.right-bottom .ribbon {
top: 80px;
right: -43px;
/* Rotate the banner -45 degrees */
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
This diff is collapsed.
Blöcke
======
(jeder Block ~ 1.5h, insgesamt 2h Pause - ein ganzer Tag git)
0. Intro
- Why VCS? (Have you ever ...?)
- Why git?
- How do I start git very basics
1. Git Commands
- working dir - index/stage - repo
2. GitLab / GitHub
- project maintanance
- issues and PRs
- "easier collaboration"
3. VCS Workflows
- how to collaborate in an organized manner
Basics
======
VCS für mich
------------
### config
### init
### add
git add foo bar
### commit
git commit -m 'foo bar'
prima -
was hat sich nu verändert?
--------------------------
### log
--stat
-p
### diff
- was ändern
- git diff
- git commit -am
### repo / stage / working
- grafik raussuchen
- wofür nutzen
### add / reset / checkout
diff und diff --staged und diff HEAD
vcs mit backup
--------------
- github neues projekt --> projekteinbindung: clone / remote add origin foo
- push
- pull
## merge
mergetool linux = meld
mac = ???
windows = ???
Workflows
=========
branching workflows
-------------------
was sind branches und wofür brauch ich sie? diese frage sollte eindeutig in diesem kapitel erklärt
werden.
### nvie successful git branching model
### multi master
paper with many journals
same paper text - different theme file for page layout, graph layout, etc.
## tips for papers
git diff -w --ignore-blank-lines --word-diff
Your Projects
=============
##### STuff
- explain all collaboration workflows via github
-
<!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>
<h3 class="date">today</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>
<script type="text/template">
# 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.
</script>
</section>
<section>
<section class="titleslide slide level1" data-markdown>
# What is git, VCS?
-
Note:
-
</section>
<section class="slide level2" data-markdown>
## What is version control?
-
Note:
-
</section>
<section class="slide level2" data-markdown>
## What is git?
-
Note:
-
</section>
<section class="slide level2" data-markdown>
## Why do we all use git?
-
Note:
-
</section>
</section>
<section id="prereq" class="titleslide slide level1" data-markdown>
<script type="text/template">
# 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
</script>
</section>
<section>
<section class="titleslide slide level1" data-markdown>
# Why git?
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.
-
Note:
-
</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/18333fig0106-tn.png

19.7 KiB

SOURCES_DOT = $(wildcard *.dot)
default: all
OBJECTS_DOT_SVG = $(SOURCES_DOT:.dot=.svg)
OBJECTS = \
$(OBJECTS_DOT_SVG)
%.svg: %.dot
dot -Tsvg -o $@ $<
$(OBJECTS):
all: $(OBJECTS)
clean:
rm -f $(OBJECTS)
.PHONY: \
all \
clean \
default
img/boy-scout-rule.jpg

49.2 KiB

img/company-logo-small.png

8.74 KiB

img/git-merge-is-bad.png

307 KiB