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 @@ ...@@ -43,6 +43,14 @@
- collaborate! - collaborate!
</section> </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> <section id="intro-version-control" data-markdown>
## about version control ## about version control
...@@ -258,35 +266,50 @@ ...@@ -258,35 +266,50 @@
</section> </section>
<!--------------------------------------------------------------------- <!---------------------------------------------------------------------
<!-- basic command line usage <!-- install and setup
<!--------------------------------------------------------------------> <!-------------------------------------------------------------------->
<section> <section>
<section id="setup" data-markdown> <section id="install" data-markdown>
# setup # 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: notes:
- installation - [Windows Subsystem for Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)
- configuration - who needs install? others can go instant break
</section> </section>
</section>
<section id="setup-cli" data-markdown> <section id="break-1" data-markdown>
## command line # break
notes:
- keep break short, only for installation
- hand out cheat sheets
</section>
- Ellen Ripley uses command line <section>
- Chuck Norris uses command line <section id="setup" data-markdown>
# setup
</section> </section>
<section id="setup-os-packages" data-markdown> <section id="setup-cli" data-markdown>
## os packages ## command line
- **Linux:** bash and git ![staging area](img/matrix-pill.jpg)
- **Mac:** bash and git
- **Windows 10+:** WSL
- **Windows < 10:** cmder
notes: 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>
<section id="cli-description" data-markdown> <section id="cli-description" data-markdown>
...@@ -351,9 +374,6 @@ ...@@ -351,9 +374,6 @@
<section id="cli-basic" data-markdown> <section id="cli-basic" data-markdown>
# git command line # git command line
## local repositories ## local repositories
notes:
- hand out cheat sheets NOW
</section> </section>
<section id="cli-create-repository" data-markdown> <section id="cli-create-repository" data-markdown>
...@@ -369,6 +389,15 @@ ...@@ -369,6 +389,15 @@
cd path/to/project cd path/to/project
git init 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>
<section id="cli-git-status" data-markdown> <section id="cli-git-status" data-markdown>
...@@ -392,6 +421,15 @@ ...@@ -392,6 +421,15 @@
### the staging area ### the staging area
![staging area](img/staging-area.svg) ![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>
<section id="cli-git-files" data-markdown> <section id="cli-git-files" data-markdown>
...@@ -410,6 +448,11 @@ ...@@ -410,6 +448,11 @@
git mv source destination git mv source destination
git rm file 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>
<section id="cli-git-diff-1" data-markdown> <section id="cli-git-diff-1" data-markdown>
...@@ -432,15 +475,42 @@ ...@@ -432,15 +475,42 @@
```bash ```bash
# opens editor for you to edit commit message # opens editor for you to edit commit message
git commit git commit [-v]
# commits with a short message # commits with a short message
git commit -m 'adds license and readme' git commit -m 'initial commit'
``` ```
</section> </section>
<section id="commit-message-conventions" data-markdown> <section id="commit-messages-xkcd" data-markdown>
## TODO ## 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>
<section id="cli-git-log" data-markdown> <section id="cli-git-log" data-markdown>
...@@ -461,34 +531,49 @@ ...@@ -461,34 +531,49 @@
``` ```
</section> </section>
<section id="cli-demo-basic" data-markdown> <section id="summary-1" data-markdown>
## demo ## you can now
### basic commands
notes: - track changes in your projects
- mkdir ~/projects - browse your projects history
- git init hello - show when and why which changes were made
- README.md
- LICENSE
- src/hello.py
</section> </section>
<section id="licenses-software" data-markdown> <section id="summary-2" data-markdown>
## software licenses ## 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>
<section id="licenses-none" data-markdown> <section id="licenses-none" data-markdown>
## no license ## no license
- exclusive copyright to **each!** author - exclusive copyright to **each!** author
- **no one** can use, copy, distribute and modify - **no one** can use, copy, distribute or modify
- platform: terms of service </section>
https://choosealicense.com <section id="licenses-software" data-markdown>
## software licenses
![software licenses](img/license-chooser.svg)
</section> </section>
<section id="licenses-other" data-markdown> <section id="licenses-other" data-markdown>
...@@ -496,27 +581,16 @@ ...@@ -496,27 +581,16 @@
- media, documentation: creative commons - media, documentation: creative commons
- paper / thesis: journal vs legal department - 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>
<section id="cli-your-turn" data-markdown> <section id="licenses-choose" data-markdown>
# your turn ## guide
- pick project
- make commits
- use status and diff!
notes: https://choosealicense.com
- deputize those who already have
</section> </section>
</section> </section>
<section id="break" data-markdown> <section id="break-2" data-markdown>
# break # break
</section> </section>
...@@ -536,14 +610,21 @@ ...@@ -536,14 +610,21 @@
- has all been local - has all been local
- repo contains entire project history - repo contains entire project history
- not yet answered: - not yet answered:
- how to publish? - how to use remotes
- how to contribute? - how to collaborate
notes:
- collaboration needs remote repositories
- by-product of remotes is backup
</section> </section>
<section id="distributed-remotes" data-markdown> <section id="distributed-remotes" data-markdown>
## remotes ## remotes
![remotes](img/git-remote-solo.svg) ![remotes](img/git-remote-solo.svg)
notes:
- remotes have names, default to origin
</section> </section>
<section id="distributed-webapps" data-markdown> <section id="distributed-webapps" data-markdown>
...@@ -552,24 +633,67 @@ ...@@ -552,24 +633,67 @@
- GitLab demo - GitLab demo
- GitHub (no demo) - GitHub (no demo)
notes:
- log in
- create project
- push / pull
</section> </section>
</section>
<section id="distributed-remote-clone" data-markdown> <!---------------------------------------------------------------------
## command line <!-- branch and merge
### clone repositories <!-------------------------------------------------------------------->
<section>
<section id="branch-merge" data-markdown>
# branch and merge
notes:
- what was this **master** again?
</section>
<section id="branches" data-markdown>
## branches
```bash ```bash
# create local copy of existing repository # show your local branches
git clone https://github.com/user/project-name.git 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>
<section id="distributed-your-turn" data-markdown> <section id="merging" data-markdown>
## your turn ## resolving branches
- log in ```bash
- create project # resolve branch by merging
- fetch / push / pull 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>
</section> </section>
...@@ -580,6 +704,9 @@ ...@@ -580,6 +704,9 @@
<section> <section>
<section id="collab" data-markdown> <section id="collab" data-markdown>
# collaboration # collaboration
notes:
- TODO talk about line endings
</section> </section>
<section id="collab-" data-markdown> <section id="collab-" data-markdown>
...@@ -615,6 +742,13 @@ ...@@ -615,6 +742,13 @@
... create repository in GitLab ... ... create repository in GitLab ...
... and commit changes! ... 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>
<section id="homework-collaborate" data-markdown> <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