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 (54)
Showing
with 605 additions and 295 deletions
paper.html
paper.pdf
img/git-remote-contributor.svg 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 *.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
...@@ -17,12 +17,22 @@ pandoc-papers.pdf: pandoc-papers.md ...@@ -17,12 +17,22 @@ pandoc-papers.pdf: pandoc-papers.md
-o pandoc-papers.pdf \ -o pandoc-papers.pdf \
pandoc-papers.md 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 # git advanced -- how to maintain a comprehensible history
- when projects get bigger - when projects get bigger
......
<!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" />
...@@ -32,39 +39,68 @@ ...@@ -32,39 +39,68 @@
notes: notes:
- `make -B` to create images - `make -B` to create images
- two terminals each with same tmux session, increase font size - two terminals each with same tmux session, increase font size
- `export LANG=en_US.UTF-8`
- `export PS1="\\[\\033[0;36m\\]\\w\\[\\033[0;35m\\]\$(__git_ps1 \" (%s)\")\\[\\033[0;36m\\] $ \\[\\033[0m\\]"` - `export PS1="\\[\\033[0;36m\\]\\w\\[\\033[0;35m\\]\$(__git_ps1 \" (%s)\")\\[\\033[0;36m\\] $ \\[\\033[0m\\]"`
- remove git config for demo - remove git config for demo
- log in to git.idiv.de - log in to git.idiv.de
- cheat sheets are handed out later - 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 is 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 is 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 are handing out is a git repo - and it is not too much effort
- if it does not support version control, i.e. text, do not 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
...@@ -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 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="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
...@@ -564,7 +569,7 @@ ...@@ -564,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
...@@ -572,23 +577,21 @@ ...@@ -572,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>
...@@ -600,8 +603,11 @@ ...@@ -600,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>
...@@ -653,14 +659,22 @@ ...@@ -653,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>
...@@ -681,6 +695,7 @@ ...@@ -681,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
...@@ -785,10 +800,11 @@ ...@@ -785,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>
...@@ -804,7 +820,7 @@ ...@@ -804,7 +820,7 @@
notes: notes:
- this is a demo chapter, you will 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 have not 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>
...@@ -817,7 +833,7 @@ ...@@ -817,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
...@@ -828,10 +844,10 @@ ...@@ -828,10 +844,10 @@
<section id="branch-when-to-use" data-markdown> <section id="branch-when-to-use" data-markdown>
## when to use branches ## when to use branches
- breaking **master** - breaking **main**
- something takes longer - something takes longer
- frequent interruptions - frequent interruptions
- comment out code - (instead of) comment out code
notes: notes:
- if logical commit without breaking do not branch - if logical commit without breaking do not branch
...@@ -851,7 +867,7 @@ ...@@ -851,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:
...@@ -859,7 +875,7 @@ ...@@ -859,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
``` ```
...@@ -883,7 +899,7 @@ ...@@ -883,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>
...@@ -892,7 +908,7 @@ ...@@ -892,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
...@@ -901,7 +917,7 @@ ...@@ -901,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
``` ```
...@@ -930,21 +946,14 @@ ...@@ -930,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>
...@@ -964,65 +973,34 @@ ...@@ -964,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 do not 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>
...@@ -1035,11 +1013,11 @@ ...@@ -1035,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 ...
...@@ -1057,7 +1035,7 @@ ...@@ -1057,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
...@@ -1069,7 +1047,7 @@ ...@@ -1069,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
...@@ -1079,6 +1057,20 @@ ...@@ -1079,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>
...@@ -1095,7 +1087,7 @@ ...@@ -1095,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
...@@ -1111,12 +1103,49 @@ ...@@ -1111,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>
...@@ -1133,7 +1162,8 @@ ...@@ -1133,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>
...@@ -1141,30 +1171,28 @@ ...@@ -1141,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"/>
......
...@@ -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"]
} }
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"]
}
digraph {
compound = true
node [shape = "box", style = "filled, rounded"]
subgraph cluster_software_a {
label = "software A"
node [color = orchid]
software_a_version_a[label = "v2.1.6"]
}
subgraph cluster_software_b {
label = "software B"
node [color = orchid]
software_b_version_a[label = "v0.2.0"]
}
subgraph cluster_script {
label = "scripts"
node [color = lightskyblue]
script_version_a[label = "nature-v1"]
}
subgraph cluster_paper {
label = "paper"
node [color = limegreen]
paper_version_a[label = "nature-review-1"]
}
script_version_a -> software_a_version_a [label = "\n\n"]
script_version_a -> software_b_version_a [label = "\n\n"]
paper_version_a -> script_version_a [label = "\n\n"]
}
digraph {
compound = true
node [shape = "box", style = "filled, rounded"]
subgraph cluster_software_a {
label = "software A"
node [color = orchid]
software_a_version_a[label = "v2.1.6"]
}
subgraph cluster_software_b {
label = "software B"
node [color = orchid]
software_b_version_b[label = "v0.3.4"]
software_b_version_a[label = "v0.2.0"]
}
subgraph cluster_script {
label = "scripts"
node [color = lightskyblue]
script_version_b[label = "nature-v2"]
script_version_a[label = "nature-v1"]
}
subgraph cluster_paper {
label = "paper"
node [color = limegreen]
paper_version_a[label = "nature-review-1"]
paper_version_b[label = "nature-review-2"]
}
script_version_a -> software_a_version_a [label = "\n\n"]
script_version_b -> software_a_version_a [label = "\n\n"]
script_version_a -> software_b_version_a [label = "\n\n"]
script_version_b -> software_b_version_b [label = "\n\n"]
paper_version_a -> script_version_a [label = "\n\n"]
paper_version_b -> script_version_b [label = "\n\n"]
}
digraph {
compound = true
node [shape = "box", style = "filled, rounded"]
subgraph cluster_software_a {
label = "software A"
node [color = orchid]
software_a_version_a[label = "v2.1.6"]
}
subgraph cluster_software_b {
label = "software B"
node [color = orchid]
software_b_version_b[label = "v0.3.4"]
software_b_version_a[label = "v0.2.0"]
}
subgraph cluster_script {
label = "scripts"
node [color = lightskyblue]
script_version_b[label = "nature-v2"]
script_version_a[label = "nature-v1"]
}
subgraph cluster_paper {
label = "paper"
node [color = limegreen]
paper_version_a[label = "nature-review-1"]
paper_version_b[label = "nature-review-2"]
paper_version_c[label = "nature-final"]
}
script_version_a -> software_a_version_a [label = "\n\n"]
script_version_b -> software_a_version_a [label = "\n\n"]
script_version_a -> software_b_version_a [label = "\n\n"]
script_version_b -> software_b_version_b [label = "\n\n"]
paper_version_a -> script_version_a [label = "\n\n"]
paper_version_b -> script_version_b [label = "\n\n"]
paper_version_c -> script_version_b [label = "\n\n"]
}
digraph {
node [shape = "box", style = "filled,rounded"]
workdir[label = "working directory\n(changes not staged for commit)", color = lightskyblue]
stage[label = "staging area\n(changes to be committed)", color = orchid]
repo[label = "repository\n(tracked content)", color = limegreen]
workdir -> stage [label = "git diff"]
stage -> repo [label = "git diff --staged"]
}
...@@ -10,10 +10,10 @@ digraph { ...@@ -10,10 +10,10 @@ digraph {
# untracked -> stage [label = "git add"] # untracked -> stage [label = "git add"]
# stage -> untracked [label = "git unstage"] # stage -> untracked [label = "git unstage"]
workdir -> stage [label = "git stage file"] workdir:sw -> stage:w [label = "git stage file"]
stage -> workdir [label = "git unstage file"] stage:e -> workdir:se [xlabel = "git unstage file"]
# workdir -> discard [label = "git checkout"] # workdir -> discard [label = "git restore"]
# untracked -> discard [label = "rm"] # untracked -> discard [label = "rm"]
stage -> repo [label = "git commit"] stage -> repo [label = "git commit"]
......