Skip to content
Snippets Groups Projects
Verified Commit 01185a7e authored by ck85nori's avatar ck85nori :railway_track:
Browse files

update

parent bf914c60
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,14 @@
- collaborate!
</section>
<section id="intro-agenda" data-markdown>
## agenda
1. intro and installation
1. setup and local repositories
1. remote repositories and collaboration
</section>
<section id="intro-version-control" data-markdown>
## about version control
......@@ -258,35 +266,50 @@
</section>
<!---------------------------------------------------------------------
<!-- basic command line usage
<!-- install and setup
<!-------------------------------------------------------------------->
<section>
<section id="setup" data-markdown>
# setup
<section id="install" data-markdown>
# install
</section>
<section id="setup-os-packages" data-markdown>
## os packages
- **Linux:** `bash` and `git`
- **Mac:** `bash` and `git`
- **Windows 10+:** `WSL`
- **Windows < 10:** `cmder`
notes:
- installation
- configuration
- [Windows Subsystem for Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)
- who needs install? others can go instant break
</section>
</section>
<section id="setup-cli" data-markdown>
## command line
<section id="break-1" data-markdown>
# break
notes:
- keep break short, only for installation
- hand out cheat sheets
</section>
- Ellen Ripley uses command line
- Chuck Norris uses command line
<section>
<section id="setup" data-markdown>
# setup
</section>
<section id="setup-os-packages" data-markdown>
## os packages
<section id="setup-cli" data-markdown>
## command line
- **Linux:** bash and git
- **Mac:** bash and git
- **Windows 10+:** WSL
- **Windows < 10:** cmder
![staging area](img/matrix-pill.jpg)
notes:
- WSL = [Windows Subsystem for Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)
- learn by doing / understand what you do
- gui hides too much of that
- use gui if gui helps workflow
</section>
<section id="cli-description" data-markdown>
......@@ -351,9 +374,6 @@
<section id="cli-basic" data-markdown>
# git command line
## local repositories
notes:
- hand out cheat sheets NOW
</section>
<section id="cli-create-repository" data-markdown>
......@@ -369,6 +389,15 @@
cd path/to/project
git init
```
notes:
- for this tutorial we are creating a new repository
- mkdir ~/projects
- git init hello
- README.md
- src/hello.lang
- for #homework you init your existing projects *without* version
control
</section>
<section id="cli-git-status" data-markdown>
......@@ -392,6 +421,15 @@
### the staging area
![staging area](img/staging-area.svg)
notes:
- can I have your attention, please?
- content can be in three stages
- we make changes, these are not yet known to git
- we prepare a commit by **successively** adding changes to the
staging area
- we commit this **set of changes**
- a commit **should be a logical unit** of changes
</section>
<section id="cli-git-files" data-markdown>
......@@ -410,6 +448,11 @@
git mv source destination
git rm file
```
notes:
- git stage git add are the same thing
- prefer stage and unstage because the opposite of add is remove
and that does something entirely different
</section>
<section id="cli-git-diff-1" data-markdown>
......@@ -432,15 +475,42 @@
```bash
# opens editor for you to edit commit message
git commit
git commit [-v]
# commits with a short message
git commit -m 'adds license and readme'
git commit -m 'initial commit'
```
</section>
<section id="commit-message-conventions" data-markdown>
## TODO
<section id="commit-messages-xkcd" data-markdown>
## commit messages
![software licenses](img/xkcd-1296-git-commit.png)
</section>
<section id="commit-messages-example" data-markdown>
## commit messages conventions
```markdown
this is a short subject line
This is the body. Notice that the subject line is short
and to the point. The body may explain in more detail why
this change was introduced.
- don't list which files changed
- the diff already tells that
References to issue trackers should be in the very end,
e.g.: fixes #42
```
notes:
- be concise
- empty line after subject
- wrap 72 characters
- remember: commit = logical unit
- the diff tells you what changed, describe why it changed
</section>
<section id="cli-git-log" data-markdown>
......@@ -461,34 +531,49 @@
```
</section>
<section id="cli-demo-basic" data-markdown>
## demo
### basic commands
<section id="summary-1" data-markdown>
## you can now
notes:
- mkdir ~/projects
- git init hello
- README.md
- LICENSE
- src/hello.py
- track changes in your projects
- browse your projects history
- show when and why which changes were made
</section>
<section id="licenses-software" data-markdown>
## software licenses
<section id="summary-2" data-markdown>
## you can now
![software licenses](img/license-chooser.svg)
> use git in **ALL** your projects
>
> -- goal 1 finished ✓
</section>
</section>
https://choosealicense.com
<!---------------------------------------------------------------------
<!-- licenses
<!-------------------------------------------------------------------->
<section>
<section id="licenses" data-markdown>
# project licenses
## aka legal shit
notes:
- unfortunately, we have to talk about this
- go back to initial commit
- initial commit should contain not just readme but license, too
</section>
<section id="licenses-none" data-markdown>
## no license
- exclusive copyright to **each!** author
- **no one** can use, copy, distribute and modify
- platform: terms of service
- **no one** can use, copy, distribute or modify
</section>
https://choosealicense.com
<section id="licenses-software" data-markdown>
## software licenses
![software licenses](img/license-chooser.svg)
</section>
<section id="licenses-other" data-markdown>
......@@ -496,27 +581,16 @@
- media, documentation: creative commons
- paper / thesis: journal vs legal department
https://choosealicense.com
</section>
<section id="cli-cheatsheet" data-markdown>
# [cheat sheet](https://idiv-biodiversity.github.io/git-cheat-sheet/)
</section>
<section id="cli-your-turn" data-markdown>
# your turn
- pick project
- make commits
- use status and diff!
<section id="licenses-choose" data-markdown>
## guide
notes:
- deputize those who already have
https://choosealicense.com
</section>
</section>
<section id="break" data-markdown>
<section id="break-2" data-markdown>
# break
</section>
......@@ -536,14 +610,21 @@
- has all been local
- repo contains entire project history
- not yet answered:
- how to publish?
- how to contribute?
- how to use remotes
- how to collaborate
notes:
- collaboration needs remote repositories
- by-product of remotes is backup
</section>
<section id="distributed-remotes" data-markdown>
## remotes
![remotes](img/git-remote-solo.svg)
notes:
- remotes have names, default to origin
</section>
<section id="distributed-webapps" data-markdown>
......@@ -552,24 +633,67 @@
- GitLab demo
- GitHub (no demo)
notes:
- log in
- create project
- push / pull
</section>
</section>
<section id="distributed-remote-clone" data-markdown>
## command line
### clone repositories
<!---------------------------------------------------------------------
<!-- branch and merge
<!-------------------------------------------------------------------->
<section>
<section id="branch-merge" data-markdown>
# branch and merge
notes:
- what was this **master** again?
</section>
<section id="branches" data-markdown>
## branches
```bash
# create local copy of existing repository
git clone https://github.com/user/project-name.git
# show your local branches
git branch
# show all branches (remotes, too)
git branch --all
# create a new branch
git branch name
# switch to a branch
git checkout name
```
notes:
- use wip/feature as branch name, see motivation playground
</section>
<section id="distributed-your-turn" data-markdown>
## your turn
<section id="merging" data-markdown>
## resolving branches
- log in
- create project
- fetch / push / pull
```bash
# resolve branch by merging
git checkout master
git merge branch-name
# delete branch
git branch -d branch-name
```
notes:
- make changes in playground
- git push
- make changes in master
- git lol
- make changes in playground
- merge
- git lol
</section>
</section>
......@@ -580,6 +704,9 @@
<section>
<section id="collab" data-markdown>
# collaboration
notes:
- TODO talk about line endings
</section>
<section id="collab-" data-markdown>
......@@ -615,6 +742,13 @@
... create repository in GitLab ...
... and commit changes!
notes:
- you will have problems
- because we only taught the basics
- use documentation or ask us
- the advanced seminar will be about some of the techniques
- TODO visualize these notes with angler vs fat deep sea fishing net
</section>
<section id="homework-collaborate" data-markdown>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment