- vim
- qtile
+### this presentation
+- is [online](https://github.com:wahrwolf/cooperative-work-with-gitt)
+
## motivation
-- everyone works in groups
-- split tasks
-- backup/versioning
-- easy/reapatable structure
-- similiar pipline
+- everyone has to do practice lessons
+- often in groups
+- typical coding
+- different content, simliar form
- tasks -> divide -> work -> merge -> submit
-- tooling
-- unix is sexy
- - few dependecy
- - hackable!
+- sometimes everyone helps, sometimes you work alone
+- working in different places
+- keep an backup/history of things
+- use standard software
+- be lazy, do not repeat yourself
-## target group
-- dudes with computers
-- hackers
-- programming exercises
-- eveything with a handout
- present/submit the solution
## common challanges
-- how to split the tasks
-- how to track the tasks
-- how to access progress made during lessons
-- who commited changes?
- how to sync progress?
+- who commited changes?
+- how to split the tasks
+- how to track progress
+- how to access code made on different maschines
- how to build submitable solutions
## tools used
- IM (e.g. whatsapp/telegram)
+ - sooo many messengers
- usb sticks
+ - you lose them
+ - you have to pass them around
- dropbox
-- skype?
+ - pain to upload per hand
+ - messes up if you work with to many
+ - hard to control what gets synched
+- Editors/IDE
+ - free yourself
+- prezi/powerpoint
+ - try to move stuff
# goals
## working on files
+- everyone has access to the code
+ - from all devices
+ - sometiems even other groups
+- named versions
+ - I want to see who fckd things up
- everything is saved
- easy diff view
- import/export of work during lessons
- create a group/mail list for every group
- create a git repo for every course
- track work using git (everytime everywhere)
+
+### Note
+- from here on we will actually do stuff
+- work along with me
+- please ask questions
+- please try things out!
- generate ssh keys
- `mkdir -p ~/.ssh/keys`
- `ssh-keygen -f ~/.ssh/keys/gogs_rsa`
-- ssh config:
+
+### ssh config:
```
- #/home/user/.ssh/config
- Host gogs
- Hostname gogs.mafiasi.de
- User gogs
- IdentityFile ~/.ssh/keys/gogs_rsa
- IdentitiesOnly yes
+Host gogs
+ Hostname gogs.mafiasi.de
+ User gogs
+ IdentityFile ~/.ssh/keys/gogs_rsa
+ IdentitiesOnly yes
```
## setting up the team
- send test mail
## setting up the repo
-- e.g. [here](https://gogs.mafiasi.de)
+- e.g. [gogs](https://gogs.mafiasi.de)
- add correct .gitignore
- `git clone gogs:user/{lecture}-{semester}-{slug}`
- edit README.md
- `git add 00/`
- `git commit -m "00: init"`
+### example dir
+```
+06
+|--- ddt.pdf
+|--- task-06
+| |--- ddt.tex
+| |--- img
+| |--- octopus.png
+| ---- Teilaufgaben
+| |--- 6.1.tex
+| |--- 6.2.tex
+---- tasksheet-06.pdf
+```
--- /dev/null
+# git
+## intro
+- every commit is actually a snapshot
+ - a commit always has an ancestor
+ - all commits are part of a tree
+ - multiple branches
+ - e.g. master
+- git tracks every added blob
+- we have created and use multiple repos
+ - local
+ - gogs
+ - your team mates
+
+## what is a merge conflict?
+- git compares the history when sync
+ - sync succesfull if common ancestor is last commit
+ - conflict if history differs
+- git comes with a few options to handle merge conflicts
+ - rebase: search for common ancestor and reapply commits on it
+ - git mergetool
+ - manual merge: conflict section are marked. get rid of one!
+
+### NO PANIC
+git normaly tells you what to do!
+Keep calm and resolv!
+
+## useful comments
+### git blame
+- tells you which line was changed by whom
+
+### git log
+- shows all commits (searchable)
+
+### git reverse
+- reverse a single commit
+
+### git cherrypick
+- copies a single commit and execute it on the HEAD
+
+## tipps
+- use on daily base
+- read first, google second
+- checkout the [book](https://git-scm.com/book/en/v2) and the [tutorial](https://try.github.io)
+- always rebase
+- use branches if you want to test something
+- you can recover stashes
+- keep your `.gitignore` up to date
+- more files, less conflicts
+- mindful commit messages
+ - what will be changed vs what this will change
+- evey subtask should be one commit
+
+++ /dev/null
-# thoughts (and prayers)
-
-# the fix
-## tooling
-- git
-- grep
-- make
-- compiler
- - gcc
- - pdflatex
-
-# the fix - init
-
-## project dir structure
-```
-lecture-practice
-|--- .git
-|--- .gitignore
-|--- points
----- README.md
-```
-
-## init - extended
-- add a .gitignore
-- private vs public repo
-
-## add a task sheet
-- create a dir per lesson
- - e.g. 00, 01, 02 ...
-- setup a simple structure
-- add first tasksheet, material etc
- - `git commit -m "0X: init"`
-
-## task dir structure
-```
-01
-|--- 01-extra
-|--- solution
-|--- src
----- tasksheet-01.pdf
-```
-
-## create dummy solution
-- seperate tasks
-- add a build script
- - makefile
-- `git commit -m "0X: adds dummy"`
-
-## dummy solution - exapmle
-```
-06
-|--- Abgabe
-| |--- ddt.pdf
-| |--- timempi2.c
-| |--- timempi.c
-| ---- timempi.sh
-|--- task-03
-| |--- ddt.tex
-| |--- img
-| ---- Teilaufgaben
-| |--- 3.1.tex
-| |--- 3.2.tex
-| |--- 3.3.tex
-| ---- 3.4.tex
----- tasksheet-06.pdf
-```
-