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 ...@@ -2,5 +2,15 @@ img/git-remote-contributor.svg
img/git-remote-maintainer.svg img/git-remote-maintainer.svg
img/git-remote-solo.svg img/git-remote-solo.svg
img/license-chooser.svg img/license-chooser.svg
img/motivation-structure.svg
img/motivation-throwaway-playground.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 img/staging-area.svg
paper.html
paper.pdf
*.pdf
img/staging-area-diff.svg
/img/rdm-use-case-merged.svg
[submodule "reveal.js"] [submodule "reveal.js"]
path = reveal.js path = reveal.js
url = https://github.com/hakimel/reveal.js.git 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 = \ ...@@ -4,12 +4,35 @@ SUBDIRS = \
$(SUBDIRS): $(SUBDIRS):
$(MAKE) -C $@ $(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 all: subdirs
clean: clean:
for dir in $(SUBDIRS); do \ for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@; \ $(MAKE) -C $$dir $@; \
done done
rm -f rdm.pdf
default: all 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
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="author" content="Dirk Sarpe and Christian Krause" />
<title>git basics</title> <title>git basics</title>
<meta name="description" content="a git seminar for beginners" />
<meta name="author" content="Dirk Sarpe and Christian Krause" />
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <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" /> <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" />
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css" /> <link rel="stylesheet" href="reveal.js/dist/reset.css">
<style type="text/css">code{white-space: pre;}</style> <link rel="stylesheet" href="reveal.js/dist/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/black.css" id="theme" /> <link rel="stylesheet" href="reveal.js/dist/theme/black.css" id="theme">
<link rel="stylesheet" href="reveal.js/plugin/highlight/monokai.css">
<link rel="stylesheet" href="css/company-logo.css" /> <link rel="stylesheet" href="css/company-logo.css" />
<link rel="stylesheet" href="css/ribbon.css" /> <link rel="stylesheet" href="css/ribbon.css" />
<link rel="stylesheet" href="css/crawl.css" /> <link rel="stylesheet" href="css/crawl.css" />
...@@ -30,41 +37,70 @@ ...@@ -30,41 +37,70 @@
## for beginner-level git users ## for beginner-level git users
notes: notes:
- terminal session preparation: - `make -B` to create images
- two terminals each with same tmux session, check font size - two terminals each with same tmux session, increase font size
- remove user, host and path from prompt - `export LANG=en_US.UTF-8`
- clean git config for demo - `export PS1="\\[\\033[0;36m\\]\\w\\[\\033[0;35m\\]\$(__git_ps1 \" (%s)\")\\[\\033[0;36m\\] $ \\[\\033[0m\\]"`
- close your laptops - remove git config for demo
- hand out cheat sheets later, no need to write stuff down - log in to git.idiv.de
- cheat sheets are handed out later
- if you have questions feel free to interrupt - if you have questions feel free to interrupt
- cleanup https://git.idiv.de/sc/edu/git-merge-conflict-demo
</section> </section>
<section id="intro-objectives" data-markdown> <section id="intro-goals" data-markdown>
## objectives ## goals
1. use git in **ALL** your projects
1. collaborate with each other
... is mission accomplished.
- teach you to fish notes:
- hands-on experience - there is time for fancy stuff later
- use version control! - take a few weeks getting used to git
- collaborate! - delay is good to grow your own experience
- growing pain is how we learn
</section> </section>
<section id="intro-agenda" data-markdown> <section id="intro-agenda-1" data-markdown>
## agenda ## agenda (today)
1. intro and installation 1. motivation
1. setup and local repositories 1. install and setup
1. remote repositories and collaboration 1. recording changes
1. platforms and remotes
1. collaboration
note: note:
- we have dynamic breaks, try at most 90 minutes without break - we have dynamic breaks, try at most 90 minutes without break
</section> </section>
<section id="intro-agenda-2" data-markdown>
## agenda (advanced)
1. customization (editors, IDEs)
1. project & team setup (GitLab)
1. how to project maintainer
1. automation
note:
- in smaller groups
- while today is more general, advanced will be focused on your
specific situation
</section>
<section id="intro-version-control" data-markdown> <section id="intro-version-control" data-markdown>
## about version control ## about version control
> records changes > records changes
what, who, when, why what, who, when, why
note:
- different kinds of version control systems
- for different meta-level things
- git is for text files / source code
</section> </section>
<section id="intro-about-git" data-markdown> <section id="intro-about-git" data-markdown>
...@@ -84,25 +120,10 @@ ...@@ -84,25 +120,10 @@
- doc: also means community / stackoverflow entries - doc: also means community / stackoverflow entries
</section> </section>
<section id="intro-about-today" data-markdown>
## about today
1. use git in **ALL** your projects
1. collaborate with each other
... is mission accomplished.
notes:
- there is time for fancy stuff later
- take a few weeks getting used to git
- delay is good to grow your own experience
- growing pain is how we learn
</section>
<section id="intro-about-christian" data-markdown> <section id="intro-about-christian" data-markdown>
## about christian ## about christian
- scientific computing support @ iDiv since 2014 - [scientific computing support @ iDiv](https://www.idiv.de/en/about-idiv/support-for-scientists/scientific-computing.html) since 2014
- happy git user since 2010 - happy git user since 2010
> There will never be a better version control system than git. > There will never be a better version control system than git.
...@@ -110,15 +131,6 @@ ...@@ -110,15 +131,6 @@
> -- Christian Krause, 2017 > -- Christian Krause, 2017
</section> </section>
<section id="intro-about-dirk" data-markdown>
## about dirk
- statistics and R support @ iDiv since 2014
- knows that kind of pain:
![blah](img/draft_mess_half_size.png)
</section>
<section id="intro-about-you" data-markdown> <section id="intro-about-you" data-markdown>
## about you ## about you
...@@ -139,7 +151,7 @@ ...@@ -139,7 +151,7 @@
<section id="motivation" data-markdown> <section id="motivation" data-markdown>
# motivation # motivation
> Why should I use version control? > Why should ***I*** use version control?
notes: notes:
- summarize reasons from audience - summarize reasons from audience
...@@ -152,7 +164,7 @@ ...@@ -152,7 +164,7 @@
## motivation #1 ## motivation #1
### avoid mess ### avoid mess
![blah](img/draft_mess.png) ![blah](img/motivation-draft-mess.png)
notes: notes:
- who has seen such a mess? - who has seen such a mess?
...@@ -164,11 +176,13 @@ ...@@ -164,11 +176,13 @@
## motivation #1 ## motivation #1
### want structure ### want structure
![blah](img/gitk-pretty-history.png) ![blah](img/motivation-structure.svg)
notes: notes:
- structure - structure
- who, when, why - who, when, why
- ability to inspect old versions
- ability to revert to old versions
</section> </section>
<section id="motivation-playground" data-markdown> <section id="motivation-playground" data-markdown>
...@@ -181,36 +195,19 @@ ...@@ -181,36 +195,19 @@
- test stuff without interfering - test stuff without interfering
- throw away if garbage - throw away if garbage
- integrate if good - integrate if good
- switch back and forth - switch back and forth without pain
- (done right) decision based on regression testing
</section> </section>
<section id="motivation-collaboration-1" data-markdown> <section id="motivation-collaboration-1" data-markdown>
## motivation #3 ## motivation #3
![boy scout rule](img/boy-scout-rule.jpg)
notes:
- there's a rule in ~~open source software~~ nay life
- if you want the world to be a better place
- complain about it (issue tracker)
- if you are able to fix it: do it!
</section>
<section id="motivation-collaboration-2" data-markdown>
## motivation #3
### collaboration made easy ### collaboration made easy
<!-- do not fix this typo, it's here on purpose to show collab --> <!-- do not fix this typo, it is here on purpose to show collab -->
> This text cntains a typo. > This text cntains a typo.
notes: notes:
- demo GitLab - demo **edit** ribbon
- [go to project](https://git.idiv.de/sc/edu/git-seminar) - change target branch (creates MR) to: **basics/typo**
- check if typo still in master
- edit
- change **target branch** to create merge request
- commit message: - commit message:
``` ```
fixes typo fixes typo
...@@ -219,45 +216,15 @@ ...@@ -219,45 +216,15 @@
``` ```
</section> </section>
<section id="motivation-creative-use" data-markdown> <section id="motivation-collaboration-2" data-markdown>
## motivation #4 ## motivation #3
### the creative use award
#### goes to Michael Schilli
```yml
videos:
- id: '_3i5yVoTvCs'
title: 'How to flip German pancakes'
- id: 'brPfE66FC24'
title: 'Tivo Stream Cooling Fan Replacement'
```
```console
$ youtube-sync -i videos.yml
_3i5yVoTvCs: Unchanged
brPfE66FC24: Updated OK
```
source: [Linux Magazin](http://www.linux-magazin.de/) 2018/01
</section>
<section id="motivation-use-everywhere" data-markdown>
## motivation #e
### use version control for
# *everything*
| common | less frequent | esoteric? | ![typo-pr](https://pbs.twimg.com/media/EDsklbLUEAMdusJ.png)
| ------------ |:---------------:| ---------------:|
| software | presentation | youtube |
| blog / doc | paper / thesis | soundboard |
| user config | task management | drinking games |
notes: notes:
- software, thats obvious - might not seem like much
- blog / doc: web-pages in general are more and more managed by git - but you are still making the world a better place
- e.g. this git cheat sheet we're handing out is a git repo - and it is not too much effort
- if it doesn't support version control, i.e. text, don't use it,
e.g. graphics written in dot, compiled to SVG
</section> </section>
<section id="motivation-automation" data-markdown> <section id="motivation-automation" data-markdown>
...@@ -270,7 +237,7 @@ ...@@ -270,7 +237,7 @@
- enforce **style guide** aka *code formatting* - enforce **style guide** aka *code formatting*
- ***deployment*** (app store, web server) - ***deployment*** (app store, web server)
*(see advanced seminar)* *(see advanced)*
notes: notes:
- buzzwords: - buzzwords:
...@@ -288,18 +255,31 @@ ...@@ -288,18 +255,31 @@
<div data-markdown> <div data-markdown>
1. revert a bad change? 1. revert a bad change?
1. view the history? 1. view the history?
1. know why someone changed it? 1. know why someone changed it?
1. maintain multiple versions? 1. maintain multiple versions?
1. see the diff of two versions? 1. see the diff of two versions?
1. find commit that broke something? 1. find commit that broke something?
1. have free backup? 1. have free backup?
1. have non-interfering playgrounds? 1. have non-interfering playgrounds?
1. have automated testing? 1. have automated testing?
1. have automated deployment? 1. have automated deployment?
1. forget about ms word comments? 1. forget about ms word comments?
1. contribute to a project? 1. contribute to a project?
1. share your code? 1. share your code?
1. let other people do the work for you? 1. let other people do the work for you?
</div> </div>
...@@ -317,6 +297,20 @@ ...@@ -317,6 +297,20 @@
# install # install
</section> </section>
<section id="setup-cli" data-markdown>
## command line
![just take the damn red pill](img/matrix-pill.jpg)
notes:
- learn by doing / understand what you do
- GUI hides too much of that
- use GUI only if it integrates well in your workflow, e.g. IDE
- my main editor is emacs, so I am using emacs integration (magit)
for most of my day-to-day tasks, only a few key presses per git
operation, when I am in the terminal, I simply use the CLI
</section>
<section id="install-os-packages" data-markdown> <section id="install-os-packages" data-markdown>
## os packages ## os packages
...@@ -325,9 +319,9 @@ ...@@ -325,9 +319,9 @@
- **Windows:** [git bash](https://git-scm.com/download/win) - **Windows:** [git bash](https://git-scm.com/download/win)
notes: notes:
- **Windows Subsystem for Linux (WSL)**: we don't use it because it - **Windows Subsystem for Linux (WSL)**: we do not use it because
can't use native Windows editors it cannot use native Windows editors
- **cmder**: we've tried it, it sucks - **cmder**: we have tried it, it sucks
</section> </section>
<section id="install-your-turn" data-markdown> <section id="install-your-turn" data-markdown>
...@@ -337,6 +331,9 @@ ...@@ -337,6 +331,9 @@
1. install git CLI 1. install git CLI
1. open terminal 1. open terminal
1. type: `git version` 1. type: `git version`
notes:
- we **need** git 2.23 for `git switch` and `git restore`
</section> </section>
</section> </section>
...@@ -348,20 +345,6 @@ ...@@ -348,20 +345,6 @@
- add **break** here if needed - add **break** here if needed
</section> </section>
<section id="setup-cli" data-markdown>
## command line
![just take the damn red pill](img/matrix-pill.jpg)
notes:
- learn by doing / understand what you do
- GUI hides too much of that
- use GUI only if it integrates well in your workflow, e.g. IDE
- my main editor is emacs, so I'm using emacs integration (magit)
for most of my day-to-day tasks, only a few key presses per git
operation, when I'm in the terminal, I simply use the CLI
</section>
<section id="cli-description" data-markdown> <section id="cli-description" data-markdown>
## command line ## command line
### description syntax ### description syntax
...@@ -405,6 +388,16 @@ ...@@ -405,6 +388,16 @@
nano file # edit file (Linux / Mac) nano file # edit file (Linux / Mac)
notepad file # edit file (Windows) notepad file # edit file (Windows)
``` ```
notes:
- go through commands then everyone open terminal
- create a directory
- create README
- rename directory
- copy README to README.md
- use autocompletion with tab
- use bash history with cursor and ctrl+r
- explain `.` and `..`
</section> </section>
<section id="cli-git" data-markdown> <section id="cli-git" data-markdown>
...@@ -420,53 +413,61 @@ ...@@ -420,53 +413,61 @@
``` ```
</section> </section>
<section id="cheat-sheet" data-markdown>
## cheat sheet
https://idiv-biodiversity.github.io/git-cheat-sheet/
</section>
<section id="setup-git-1" data-markdown> <section id="setup-git-1" data-markdown>
## git setup #1 ## git setup #1
```bash ```bash
# configure your identity # configure your identity
git config --global user.name 'Jane Doe' git config --global user.name "Jane Doe"
git config --global user.email 'jane.doe@riot-grrrl.org' git config --global user.email "jane.doe@idiv.de"
# show colors # show colors
git config --global color.ui auto git config --global color.ui auto
# configure aliases # configure aliases
git config --global alias.unstage 'reset HEAD --' git config --global alias.unstage "reset HEAD --"
git config --global alias.lol \ git config --global alias.lol \
'log --graph --decorate --oneline --all' "log --graph --decorate --oneline --all"
# show config # show config
git config --list git config --list [--global]
``` ```
notes: notes:
- hand out cheat sheets **now** - hand out cheat sheets **now**
- for Windows: check that `core.autocrlf true`, but do not waste
time explaining it for everyone
</section> </section>
<section id="setup-git-2" data-markdown> <section id="setup-git-2" data-markdown>
## git setup #2 ## git setup #2
```bash ```bash
# command line editor # Windows
git config --global core.editor nano git config --global core.editor notepad
# Mac
git config --global core.editor "open -Wne"
# Linux GNOME / KDE # Linux GNOME / KDE
git config --global core.editor gedit git config --global core.editor gedit
git config --global core.editor kate git config --global core.editor kate
# Windows # to verify editor works
git config --global core.editor notepad git config --global --edit
git config --global core.autocrlf true
``` ```
notes: notes:
### line endings - if you already have another *core* editor for yourself, feel free
- explain the difference: Windows CRLF, everyone else LF, some to use it
accept only LF - if not, please stick to a simple-to-use one for the duration of
- maintainers may reject contributions because of line endings the seminar
- on Windows, git can do it for you, via `dos2unix`
- fine grained control with `man 5 gitattributes`
</section> </section>
</section> </section>
...@@ -481,6 +482,7 @@ ...@@ -481,6 +482,7 @@
notes: notes:
- add **break** here if needed - add **break** here if needed
- this section has demo and interactive part
</section> </section>
<section id="cli-create-repository" data-markdown> <section id="cli-create-repository" data-markdown>
...@@ -498,6 +500,7 @@ ...@@ -498,6 +500,7 @@
``` ```
notes: notes:
- this is an explanation slide
- for this tutorial we are creating a new repository - for this tutorial we are creating a new repository
- at home you can `init` your existing projects *without* version - at home you can `init` your existing projects *without* version
control control
...@@ -511,6 +514,8 @@ ...@@ -511,6 +514,8 @@
1. write a short `README` file 1. write a short `README` file
notes: notes:
- mention cheat sheet
- switch to terminal after a while and demo solution
```bash ```bash
mkdir ~/projects mkdir ~/projects
git init hello git init hello
...@@ -532,7 +537,7 @@ ...@@ -532,7 +537,7 @@
- important git command - important git command
- shows a lot of information - shows a lot of information
- shows basic git commands - shows basic git commands
- later, we'll see different outputs - later, we will see different outputs
</section> </section>
<section id="internals-staging-area" data-markdown> <section id="internals-staging-area" data-markdown>
...@@ -541,7 +546,7 @@ ...@@ -541,7 +546,7 @@
![staging area](img/staging-area.svg) ![staging area](img/staging-area.svg)
notes: notes:
- **don't demo here! that's done during next slide, this one is - **do not demo here! that is done during next slide, this one is
about the concept of the staging area** about the concept of the staging area**
- **call for attention, this is important** - **call for attention, this is important**
- in a local git repository, content can be in three stages - in a local git repository, content can be in three stages
...@@ -550,7 +555,8 @@ ...@@ -550,7 +555,8 @@
- **commit** this **set of changes** - **commit** this **set of changes**
- commit **should be a logical unit** of changes - commit **should be a logical unit** of changes
- the deciding feature of a git (G)UI is how it handles the stage, - the deciding feature of a git (G)UI is how it handles the stage,
i.e. if you can't interactively stage/unstage hunks, the UI sucks i.e. if you cannot interactively stage/unstage hunks, the UI
sucks
</section> </section>
<section id="cli-git-files" data-markdown> <section id="cli-git-files" data-markdown>
...@@ -563,7 +569,7 @@ ...@@ -563,7 +569,7 @@
git unstage file git unstage file
# discard changes # discard changes
git checkout file git restore file
# rename and remove # rename and remove
git mv source destination git mv source destination
...@@ -571,23 +577,21 @@ ...@@ -571,23 +577,21 @@
``` ```
notes: notes:
- git stage git add are the same thing - users should do this in a terminal with demo by us
- prefer stage and unstage because the opposite of add is remove - `git stage` and `git add` are the same thing
and that does something entirely different - prefer `stage` and `unstage` because the opposite of `add` is
`rm` and that does something entirely different
</section> </section>
<section id="cli-git-diff-1" data-markdown> <section id="cli-git-diff" data-markdown>
## command line ## command line
### show changes ### show changes
```bash ![git diff](img/staging-area-diff.svg)
# from staging area to current working copy
git diff
# show contents of staging area, i.e. notes:
# from last commit to staging area - users should do this in a terminal with demo by us
git diff --staged - make a round and check
```
</section> </section>
<section id="cli-git-commit" data-markdown> <section id="cli-git-commit" data-markdown>
...@@ -599,8 +603,11 @@ ...@@ -599,8 +603,11 @@
git commit [-v] git commit [-v]
# commits with a short message # commits with a short message
git commit -m 'initial commit' git commit -m "initial commit"
``` ```
notes:
- users execute commit after next two explanation slides
</section> </section>
<section id="commit-messages-xkcd" data-markdown> <section id="commit-messages-xkcd" data-markdown>
...@@ -619,7 +626,7 @@ ...@@ -619,7 +626,7 @@
and to the point. The body may explain in more detail why and to the point. The body may explain in more detail why
this change was introduced. this change was introduced.
- don't list which files changed - do not list which files changed
- the diff already tells that - the diff already tells that
References to issue trackers should be in the very end, e.g.: References to issue trackers should be in the very end, e.g.:
...@@ -652,14 +659,22 @@ ...@@ -652,14 +659,22 @@
# - one per line # - one per line
git lol git lol
``` ```
notes:
- make a round and check
</section> </section>
<section id="summary-1" data-markdown> <section id="summary-1" data-markdown>
## you can now ## you can now
- track changes in your projects - create local repos (`init`)
- browse your projects history - track changes in your projects (`stage`, `commit`)
- see why a change was introduced - browse your projects history (`log`)
- rest are helpers (`status`, `diff`, `restore`)
notes:
- very important: `status`
- demo emacs git integration to show `stage -p`
</section> </section>
<section id="summary-2" data-markdown> <section id="summary-2" data-markdown>
...@@ -680,6 +695,7 @@ ...@@ -680,6 +695,7 @@
## aka legal shit ## aka legal shit
notes: notes:
- non interactive section
- add **break** here if needed - add **break** here if needed
- unfortunately, we have to talk about this - unfortunately, we have to talk about this
- go back to initial commit - go back to initial commit
...@@ -772,7 +788,7 @@ ...@@ -772,7 +788,7 @@
note: note:
- show both commands in web interface when creating new repository - show both commands in web interface when creating new repository
- explain HTTPS and SSH URLs - explain HTTPS and SSH URLs
- for seminar, we'll stick to HTTPS - for seminar, we will stick to HTTPS
- you can set up password manager integration later, git integrates - you can set up password manager integration later, git integrates
well with the common ones well with the common ones
</section> </section>
...@@ -784,10 +800,11 @@ ...@@ -784,10 +800,11 @@
![remotes](img/git-remote-solo.svg) ![remotes](img/git-remote-solo.svg)
notes: notes:
- remotes have names, default to origin - remotes have names, default to **origin**
- remotes are **full clones**, i.e. entire history - remotes are usually **full clones**, i.e. entire history, all
- **fetch** is on the box, so you **fetch everything** commits, all branches
- **fetch** does not integrate branches, i.e. **merge** - **fetch** edge is on the box, so you fetch **everything**
- **fetch** does not integrate branches, i.e. no **merge**
- **push** and **pull** also **merge** the *tracking* branch - **push** and **pull** also **merge** the *tracking* branch
</section> </section>
</section> </section>
...@@ -801,9 +818,9 @@ ...@@ -801,9 +818,9 @@
# branch and merge # branch and merge
notes: notes:
- this is a demo chapter, you'll all do this in collaboration - this is a demo chapter, you will all do this in collaboration
chapter (next one) chapter (next one)
- what was this **master** again? we haven't explained yet - what was this **main** again? we have not explained yet
</section> </section>
<section id="branch-visual" data-markdown> <section id="branch-visual" data-markdown>
...@@ -816,7 +833,7 @@ ...@@ -816,7 +833,7 @@
- create a branch to have a separate history - create a branch to have a separate history
- branch is a name attached to a commit - branch is a name attached to a commit
- the name advances when a new commit is made - the name advances when a new commit is made
- **master** is a naming convention for the default branch - **main** is a naming convention for the default branch
- switch back and forth - switch back and forth
- always imagine git history as a directed graph - always imagine git history as a directed graph
- graph is drawn with new top and old bottom - graph is drawn with new top and old bottom
...@@ -824,6 +841,18 @@ ...@@ -824,6 +841,18 @@
- git commands modify the graph - git commands modify the graph
</section> </section>
<section id="branch-when-to-use" data-markdown>
## when to use branches
- breaking **main**
- something takes longer
- frequent interruptions
- (instead of) comment out code
notes:
- if logical commit without breaking do not branch
</section>
<section id="branch-commands" data-markdown> <section id="branch-commands" data-markdown>
## branch commands ## branch commands
...@@ -838,7 +867,7 @@ ...@@ -838,7 +867,7 @@
git branch name git branch name
# switch to a branch # switch to a branch
git checkout name git switch name
``` ```
notes: notes:
...@@ -846,7 +875,7 @@ ...@@ -846,7 +875,7 @@
# branch, branch --all # branch, branch --all
git lol # show branches git lol # show branches
# branch wip/feature, lol # branch wip/feature, lol
# checkout wip/feature, lol # switch wip/feature, lol
# edit, commit, lol # edit, commit, lol
# push, lol # push, lol
``` ```
...@@ -870,7 +899,7 @@ ...@@ -870,7 +899,7 @@
``` ```
notes: notes:
- `git branch --list 'topic/*'` - `git branch --list "topic/*"`
- decide with your team, write `CONTRIBUTING.md` - decide with your team, write `CONTRIBUTING.md`
</section> </section>
...@@ -879,7 +908,7 @@ ...@@ -879,7 +908,7 @@
```bash ```bash
# resolve branch by merging # resolve branch by merging
git checkout master git switch main
git merge branch-name git merge branch-name
# delete branch # delete branch
...@@ -888,7 +917,7 @@ ...@@ -888,7 +917,7 @@
notes: notes:
``` ```
# checkout master, lol # switch main, lol
# merge wip/feature, lol # merge wip/feature, lol
# branch -d wip/feature, lol # branch -d wip/feature, lol
``` ```
...@@ -917,21 +946,14 @@ ...@@ -917,21 +946,14 @@
notes: notes:
- we: new commit - we: new commit
- group: fetch, lol, pull upstream master, lol - group: fetch, lol, pull upstream main, lol
- group: push origin, lol - group: push origin, lol
- group: commit, push, MR (master or wip?) - group: branch, switch, commit, push, MR
- collaboration happens in issues and MR discussion! - collaboration happens in issues and MR discussion!
- we: review and possible resolve merge request in GL - we: review and possible resolve merge request in GL
- show next slide once merging is done on command line - show next slide once merging is done on command line
</section>
<section id="collab-maintainer" data-markdown>
## view of maintainer
![remotes](img/git-remote-maintainer.svg)
notes:
- we: review one MR, show line comments in GL, thumbs up - we: review one MR, show line comments in GL, thumbs up
- advanced: view of maintainer
</section> </section>
<section id="collab-review-criticism" data-markdown> <section id="collab-review-criticism" data-markdown>
...@@ -951,65 +973,34 @@ ...@@ -951,65 +973,34 @@
discussion discussion
</section> </section>
<section id="collab-review-code-of-conduct" data-markdown> <section id="collab-conflicts-contributor" data-markdown>
## review
### code of conduct
1. be friendly
1. be responsible
1. be open
1. be proactive
notes:
- the discussions are usually public, so be aware of that
- usually needed when community grows
- decide with your community, write `CONTRIBUTING.md`
</section>
<section id="collab-review-your-turn" data-markdown>
## review
### your turn
1. review a merge request
1. discuss / emote
1. comment on code
</section>
<section id="collab-conflicts" data-markdown>
## resolving conflicts ## resolving conflicts
### maintainer
```bash
git remote add alice https://...
git fetch alice
git checkout master
git merge alice/topic/feature
# fix conflicts
git push
```
### contributor
```bash ```bash
git fetch upstream git fetch upstream
git checkout topic/feature git switch topic/feature
git merge origin/master git merge origin/main
# fix conflicts # fix conflicts
git push git push
``` ```
notes: notes:
- hopefully conflicting changes - https://git.idiv.de/sc/edu/git-merge-conflict-demo
- MR status should show that (can not be merged without conflicts) - contains two conflicting branches
- maintainer decides if trivial or delegate to contributor - git lol
- git fetch
- explain different solutions
- create MR
- MR status show merge conflicts
- edit file, show how to keep both ours and theirs
</section> </section>
<section id="summary-3" data-markdown> <section id="summary-3" data-markdown>
## you can now ## you can now
- create and connect to remotes - create and connect to remotes (`clone`, `push/pull`)
- contribute to projects you don't own - contribute to projects (`switch -c`, `push -u origin`, MR/PR)
- maintain projects you own - hint: use `lol` alias
</section> </section>
<section id="summary-4" data-markdown> <section id="summary-4" data-markdown>
...@@ -1022,11 +1013,11 @@ ...@@ -1022,11 +1013,11 @@
<section> <section>
<section id="homework" data-markdown> <section id="homework" data-markdown>
# homework # "homework"
</section> </section>
<section id="homework-use-git" data-markdown> <section id="homework-use-git" data-markdown>
## homework #1 ## "homework" #1
### use git ### use git
for each project you use ... for each project you use ...
...@@ -1044,7 +1035,7 @@ ...@@ -1044,7 +1035,7 @@
</section> </section>
<section id="homework-collaborate" data-markdown> <section id="homework-collaborate" data-markdown>
## homework #2 ## "homework" #2
### collaborate ### collaborate
- talk with your colleagues - talk with your colleagues
...@@ -1056,7 +1047,7 @@ ...@@ -1056,7 +1047,7 @@
</section> </section>
<section id="homework-feedback" data-markdown> <section id="homework-feedback" data-markdown>
## homework #3 ## "homework" #3
### feedback ### feedback
https://git.idiv.de/sc/edu/git-seminar https://git.idiv.de/sc/edu/git-seminar
...@@ -1066,6 +1057,20 @@ ...@@ -1066,6 +1057,20 @@
</section> </section>
</section> </section>
<section id="intro-agenda-2" data-markdown>
## agenda advanced
1. customization (editors, IDEs)
1. project & team setup (GitLab)
1. how to project maintainer
1. automation
note:
- in smaller groups
- while today is more general, advanced will be focused on your
specific situation
</section>
<section id="eof" data-background="img/trex.png"> <section id="eof" data-background="img/trex.png">
<h1>EOF</h1> <h1>EOF</h1>
</section> </section>
...@@ -1082,7 +1087,7 @@ ...@@ -1082,7 +1087,7 @@
```bash ```bash
git remote add alice https://... git remote add alice https://...
git fetch alice git fetch alice
git rebase [--interactive] master alice/topic/feature git rebase [--interactive] main alice/topic/feature
# fix conflicts # fix conflicts
git push git push
# manually close merge request # manually close merge request
...@@ -1098,12 +1103,49 @@ ...@@ -1098,12 +1103,49 @@
```bash ```bash
git fetch upstream git fetch upstream
git rebase origin/master topic/feature git rebase origin/main topic/feature
# fix conflicts # fix conflicts
# force push because branch history changed # force push because branch history changed
git push --force git push --force
``` ```
</section> </section>
<section id="collab-maintainer" data-markdown>
## view of maintainer
![remotes](img/git-remote-maintainer.svg)
</section>
<section id="collab-review-code-of-conduct" data-markdown>
## review
### code of conduct
1. be friendly
1. be responsible
1. be open
1. be proactive
notes:
- the discussions are usually public, so be aware of that
- usually needed when community grows
- decide with your community, write `CONTRIBUTING.md`
</section>
<section id="collab-conflicts-maintainer" data-markdown>
## resolving conflicts
```bash
git remote add alice https://...
git fetch alice
git switch main
git merge alice/topic/feature
# fix conflicts
git push
```
notes:
- maintainer decides if trivial or delegate to contributor
</section>
</section> </section>
</div> </div>
</div> </div>
...@@ -1120,7 +1162,8 @@ ...@@ -1120,7 +1162,8 @@
<div class="ribbon-wrapper right"> <div class="ribbon-wrapper right">
<div class="ribbon"> <div class="ribbon">
<a href="https://git.idiv.de/sc/edu/git-seminar"> <a href="https://git.idiv.de/sc/edu/git-seminar/edit/main/basics.html"
target="_blank">
edit edit
</a> </a>
</div> </div>
...@@ -1128,30 +1171,28 @@ ...@@ -1128,30 +1171,28 @@
<!-- reveal.stuff --> <!-- reveal.stuff -->
<script src="reveal.js/lib/js/head.min.js"></script> <script src="reveal.js/dist/reveal.js"></script>
<script src="reveal.js/js/reveal.js"></script>
<script src="reveal.js/plugin/zoom/zoom.js"></script>
<script src="reveal.js/plugin/notes/notes.js"></script>
<script src="reveal.js/plugin/search/search.js"></script>
<script src="reveal.js/plugin/markdown/markdown.js"></script>
<script src="reveal.js/plugin/highlight/highlight.js"></script>
<script> <script>
Reveal.initialize({ Reveal.initialize({
controls: true, controls: true,
progress: true, progress: true,
slideNumber: true, center: true,
history: true, hash: true,
center: true,
keyboard: true, plugins: [
maxScale: 1.5, RevealZoom,
slideNumber: false, RevealNotes,
theme: Reveal.getQueryHash().theme, RevealSearch,
transition: Reveal.getQueryHash().transition || 'default', RevealMarkdown,
RevealHighlight,
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> </script>
</body> </body>
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<dia:real val="0.80000000000000004"/> <dia:real val="0.80000000000000004"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="pos"> <dia:attribute name="pos">
<dia:point val="30,18.6171"/> <dia:point val="30,18.6161"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="color"> <dia:attribute name="color">
<dia:color val="#000000"/> <dia:color val="#000000"/>
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
<dia:point val="33,15"/> <dia:point val="33,15"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="obj_bb"> <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>
<dia:attribute name="text"> <dia:attribute name="text">
<dia:composite type="text"> <dia:composite type="text">
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
<dia:real val="0.80000000000000004"/> <dia:real val="0.80000000000000004"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="pos"> <dia:attribute name="pos">
<dia:point val="33,14.8475"/> <dia:point val="33,14.8491"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="color"> <dia:attribute name="color">
<dia:color val="#000000"/> <dia:color val="#000000"/>
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
<dia:point val="38,15"/> <dia:point val="38,15"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="obj_bb"> <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>
<dia:attribute name="text"> <dia:attribute name="text">
<dia:composite type="text"> <dia:composite type="text">
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
<dia:real val="0.80000000000000004"/> <dia:real val="0.80000000000000004"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="pos"> <dia:attribute name="pos">
<dia:point val="38,14.8475"/> <dia:point val="38,14.8491"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="color"> <dia:attribute name="color">
<dia:color val="#000000"/> <dia:color val="#000000"/>
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
<dia:point val="33,5"/> <dia:point val="33,5"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="obj_bb"> <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>
<dia:attribute name="text"> <dia:attribute name="text">
<dia:composite type="text"> <dia:composite type="text">
...@@ -343,7 +343,7 @@ git rebase b c#</dia:string> ...@@ -343,7 +343,7 @@ git rebase b c#</dia:string>
<dia:point val="28,11"/> <dia:point val="28,11"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="obj_bb"> <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>
<dia:attribute name="text"> <dia:attribute name="text">
<dia:composite type="text"> <dia:composite type="text">
...@@ -357,7 +357,7 @@ git rebase b c#</dia:string> ...@@ -357,7 +357,7 @@ git rebase b c#</dia:string>
<dia:real val="0.80000000000000004"/> <dia:real val="0.80000000000000004"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="pos"> <dia:attribute name="pos">
<dia:point val="28,10.8475"/> <dia:point val="28,10.8491"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="color"> <dia:attribute name="color">
<dia:color val="#000000"/> <dia:color val="#000000"/>
...@@ -408,7 +408,7 @@ git rebase b c#</dia:string> ...@@ -408,7 +408,7 @@ git rebase b c#</dia:string>
<dia:real val="0.80000000000000004"/> <dia:real val="0.80000000000000004"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="pos"> <dia:attribute name="pos">
<dia:point val="51,12.195"/> <dia:point val="51,12.1941"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="color"> <dia:attribute name="color">
<dia:color val="#000000"/> <dia:color val="#000000"/>
...@@ -502,7 +502,7 @@ git rebase b c#</dia:string> ...@@ -502,7 +502,7 @@ git rebase b c#</dia:string>
<dia:point val="56,15"/> <dia:point val="56,15"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="obj_bb"> <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>
<dia:attribute name="text"> <dia:attribute name="text">
<dia:composite type="text"> <dia:composite type="text">
...@@ -516,7 +516,7 @@ git rebase b c#</dia:string> ...@@ -516,7 +516,7 @@ git rebase b c#</dia:string>
<dia:real val="0.80000000000000004"/> <dia:real val="0.80000000000000004"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="pos"> <dia:attribute name="pos">
<dia:point val="56,14.8475"/> <dia:point val="56,14.8491"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="color"> <dia:attribute name="color">
<dia:color val="#000000"/> <dia:color val="#000000"/>
...@@ -535,7 +535,7 @@ git rebase b c#</dia:string> ...@@ -535,7 +535,7 @@ git rebase b c#</dia:string>
<dia:point val="61,15"/> <dia:point val="61,15"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="obj_bb"> <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>
<dia:attribute name="text"> <dia:attribute name="text">
<dia:composite type="text"> <dia:composite type="text">
...@@ -549,7 +549,7 @@ git rebase b c#</dia:string> ...@@ -549,7 +549,7 @@ git rebase b c#</dia:string>
<dia:real val="0.80000000000000004"/> <dia:real val="0.80000000000000004"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="pos"> <dia:attribute name="pos">
<dia:point val="61,14.8475"/> <dia:point val="61,14.8491"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="color"> <dia:attribute name="color">
<dia:color val="#000000"/> <dia:color val="#000000"/>
...@@ -598,14 +598,14 @@ git rebase b c#</dia:string> ...@@ -598,14 +598,14 @@ git rebase b c#</dia:string>
<dia:point val="56,5"/> <dia:point val="56,5"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="obj_bb"> <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>
<dia:attribute name="text"> <dia:attribute name="text">
<dia:composite type="text"> <dia:composite type="text">
<dia:attribute name="string"> <dia:attribute name="string">
<dia:string>#cherry-pick <dia:string>#cherry-pick
git checkout b git switch b
git cherry-pick a...c#</dia:string> git cherry-pick a...c#</dia:string>
</dia:attribute> </dia:attribute>
<dia:attribute name="font"> <dia:attribute name="font">
...@@ -652,7 +652,7 @@ git cherry-pick a...c#</dia:string> ...@@ -652,7 +652,7 @@ git cherry-pick a...c#</dia:string>
<dia:point val="51,11"/> <dia:point val="51,11"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="obj_bb"> <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>
<dia:attribute name="text"> <dia:attribute name="text">
<dia:composite type="text"> <dia:composite type="text">
...@@ -666,7 +666,7 @@ git cherry-pick a...c#</dia:string> ...@@ -666,7 +666,7 @@ git cherry-pick a...c#</dia:string>
<dia:real val="0.80000000000000004"/> <dia:real val="0.80000000000000004"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="pos"> <dia:attribute name="pos">
<dia:point val="51,10.8475"/> <dia:point val="51,10.8491"/>
</dia:attribute> </dia:attribute>
<dia:attribute name="color"> <dia:attribute name="color">
<dia:color val="#000000"/> <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 { ...@@ -6,7 +6,7 @@ digraph {
node [color = orchid] node [color = orchid]
omaster[label = "master"] omain[label = "main"]
} }
subgraph clusterlocal { subgraph clusterlocal {
...@@ -14,7 +14,7 @@ digraph { ...@@ -14,7 +14,7 @@ digraph {
node [color = orchid] node [color = orchid]
master[label = "master"] main[label = "main"]
} }
subgraph clusterupstream { subgraph clusterupstream {
...@@ -22,11 +22,11 @@ digraph { ...@@ -22,11 +22,11 @@ digraph {
node [color = limegreen] node [color = limegreen]
umaster[label = "master"] umain[label = "main"]
} }
omaster -> master [label = "git pull"] omain -> main [label = "git pull"]
master -> omaster [label = "git push", constraint = false] main -> omain [label = "git push", constraint = false]
umaster -> master [label = "git pull upstream master", constraint = false] umain -> main [label = "git pull upstream main", constraint = false]
omaster -> umaster [label = "pull request (GitHub)\nmerge request (GitLab)", constraint = false] omain -> umain [label = "pull request (GitHub)\nmerge request (GitLab)", constraint = false]
} }
...@@ -6,7 +6,7 @@ digraph { ...@@ -6,7 +6,7 @@ digraph {
node [color = orchid] node [color = orchid]
omaster[label = "master"] omain[label = "main"]
} }
subgraph clusterlocal { subgraph clusterlocal {
...@@ -14,7 +14,7 @@ digraph { ...@@ -14,7 +14,7 @@ digraph {
node [color = orchid] node [color = orchid]
master[label = "master"] main[label = "main"]
} }
subgraph clusteralice { subgraph clusteralice {
...@@ -22,7 +22,7 @@ digraph { ...@@ -22,7 +22,7 @@ digraph {
node [color = limegreen] node [color = limegreen]
amaster[label = "master"] amain[label = "main"]
} }
subgraph clusterbob { subgraph clusterbob {
...@@ -30,11 +30,11 @@ digraph { ...@@ -30,11 +30,11 @@ digraph {
node [color = lightskyblue] node [color = lightskyblue]
bmaster[label = "master"] bmain[label = "main"]
} }
omaster -> master [label = "git pull"] omain -> main [label = "git pull"]
master -> omaster [label = "git push", constraint = false] main -> omain [label = "git push", constraint = false]
amaster -> master [label = "git pull alice", constraint = false] amain -> main [label = "git pull alice", constraint = false]
bmaster -> master [label = "git pull bob", constraint = false] bmain -> main [label = "git pull bob", constraint = false]
} }
...@@ -9,7 +9,7 @@ digraph { ...@@ -9,7 +9,7 @@ digraph {
node [color = orchid] node [color = orchid]
omaster[label = "master"] omain[label = "main"]
} }
subgraph clusterlocal { subgraph clusterlocal {
...@@ -17,10 +17,10 @@ digraph { ...@@ -17,10 +17,10 @@ digraph {
node [color = orchid] node [color = orchid]
master[label = "master"] main[label = "main"]
} }
omaster -> master [label = "git fetch", style = dotted, ltail = clusterorigin, lhead = clusterlocal] omain -> main [label = "git fetch", style = dotted, ltail = clusterorigin, lhead = clusterlocal]
master -> omaster [label = "git push"] main -> omain [label = "git push"]
omaster -> master [label = "git pull"] 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 { digraph {
node [shape = "box", style = "filled, rounded"] node [shape = "box", style = "filled, rounded"]
subgraph clustermaster { subgraph clustermain {
label = "master" label = "main"
node [color = limegreen] node [color = limegreen]
master3[label = "ebe0262"] main3[label = "..."]
master2[label = "03f4f8d"] main2[label = "..."]
master1[label = "62a0ee9"] main1[label = "..."]
master3 -> master2 -> master1 main3 -> main2 -> main1
} }
subgraph clusterplayground { subgraph clusterplayground {
...@@ -18,11 +18,11 @@ digraph { ...@@ -18,11 +18,11 @@ digraph {
node [color = orchid] node [color = orchid]
playground2[label = "8b29f74"] playground2[label = "visualization"]
playground1[label = "7f295dd"] playground1[label = "methods"]
playground2 -> playground1 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"]
}