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

wip

parent 8e310e76
No related branches found
No related tags found
No related merge requests found
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
</head> </head>
<body> <body>
<!-- start of slides -->
<div class="reveal"> <div class="reveal">
<div class="slides"> <div class="slides">
<!---------------------------------------------------------------------
<!-- intro
<!-------------------------------------------------------------------->
<section> <section>
<section id="title" data-markdown> <section id="title" data-markdown>
# git basics # git basics
...@@ -58,7 +60,7 @@ ...@@ -58,7 +60,7 @@
1. use git in **ALL** your projects 1. use git in **ALL** your projects
2. collaborate with each other 2. collaborate with each other
... that is mission accomplished. ... is mission accomplished.
notes: notes:
- there is time for fancy stuff later - there is time for fancy stuff later
...@@ -67,7 +69,7 @@ ...@@ -67,7 +69,7 @@
- growing pain is how we learn - growing pain is how we learn
</section> </section>
<section id="intro-you" data-markdown> <section id="intro-about-you" data-markdown>
## about you ## about you
![people](img/people.jpg) ![people](img/people.jpg)
...@@ -78,7 +80,7 @@ ...@@ -78,7 +80,7 @@
<section id="intro-about-git" data-markdown> <section id="intro-about-git" data-markdown>
## about git ## about git
1. **records changes to a repository** 1. **records changes to a *repository***
content, who, when, message content, who, when, message
2. **best tool for the job** 2. **best tool for the job**
...@@ -92,6 +94,10 @@ ...@@ -92,6 +94,10 @@
</section> </section>
</section> </section>
<!---------------------------------------------------------------------
<!-- motivation
<!-------------------------------------------------------------------->
<section> <section>
<section id="motivation" data-markdown> <section id="motivation" data-markdown>
# motivation # motivation
...@@ -104,6 +110,11 @@ ...@@ -104,6 +110,11 @@
### avoid mess ### avoid mess
![blah](img/draft_mess.png) ![blah](img/draft_mess.png)
notes:
- who has seen such a mess?
- who has contributed to such a mess?
- who has created such a mess?
</section> </section>
<section id="motivation-want-structure" data-markdown> <section id="motivation-want-structure" data-markdown>
...@@ -111,6 +122,9 @@ ...@@ -111,6 +122,9 @@
### want structure ### want structure
![blah](img/gitk-pretty-history.png) ![blah](img/gitk-pretty-history.png)
notes:
- TODO better repo with more contributors
</section> </section>
<section id="motivation-playground" data-markdown> <section id="motivation-playground" data-markdown>
...@@ -131,7 +145,7 @@ ...@@ -131,7 +145,7 @@
## motivation #3 ## motivation #3
### collaboration made easy ### collaboration made easy
<!-- do not fix this typo --> <!-- do not fix this typo, it's here on purpose to show collab -->
> This text cuntains a typo. > This text cuntains a typo.
notes: notes:
...@@ -190,86 +204,398 @@ ...@@ -190,86 +204,398 @@
### automation ### automation
- software testing - software testing
- code quality
- build app and deploy to app store - build app and deploy to app store
- put presentation on web server - put presentation on web server
*(see advanced seminar)* *(see advanced seminar)*
notes:
- basically, everything you can script
</section> </section>
</section> </section>
<!---------------------------------------------------------------------
<!-- basic command line usage
<!-------------------------------------------------------------------->
<section> <section>
<section id="start" data-markdown> <section id="setup" data-markdown>
# let's get started # setup
notes: notes:
- git is simple and complex - git is simple and complex
- git seems complex for 2 reasons: - git seems complex for 2 reasons:
- you're unfamiliar with command line - you're unfamiliar with command line
- there are a lot of choices - there are a lot of choices
- only X (TODO) theory pages - only X (TODO) theory/internals pages
- I'm gonna dumb it down for you - I'm gonna dumb it down for you
- aka we'll stick to the simple parts - aka we'll stick to the simple parts
</section> </section>
<section id="cheatsheet" data-markdown> <section id="setup-cli" data-markdown>
# [cheat sheet](https://idiv-biodiversity.github.io/git-cheat-sheet/)
</section>
<section id="cli" data-markdown>
## command line ## command line
- Ellen Ripley uses command line - Ellen Ripley uses command line
- Chuck Norris uses command line - Chuck Norris uses command line
</section> </section>
<section id="os" data-markdown> <section id="setup-os-packages" data-markdown>
## os packages ## os packages
**Linux:** bash and git - **Linux:** bash and git
- **Mac:** bash and git
- **Windows:** cmder
</section>
<section id="cli-description" data-markdown>
## command line
### description syntax
```bash
# command
git
**Mac:** bash and git # sub-command
git status
**Windows:** cmder # optional
git diff [--staged]
```
</section> </section>
<section id="setup" data-markdown> <section id="cli-git" data-markdown>
## setup ## command line
### git syntax
```bash
# every git command
git command [arguments]
# get help
git help [command]
```
</section>
<section id="setup-git" data-markdown>
## git setup
```bash ```bash
# 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@feminism.org' git config --global user.email 'jane.doe@riot-grrrl.org'
# colors # show colors
git config --global color.ui auto git config --global color.ui auto
# aliases # editor
git config --global core.editor emacs
# 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'
``` ```
</section> </section>
</section>
<!---------------------------------------------------------------------
<!-- basic command line usage
<!-------------------------------------------------------------------->
<section>
<section id="cli-basic" data-markdown>
# git command line
## local repositories
</section>
<section id="cli-create-repository" data-markdown>
## command line
### create repositories
```bash
# create empty repository
git init project-name
# create repository from existing project
# which is not under version control
cd path/to/project
git init
```
</section>
<section id="cli-git-status" data-markdown>
## command line
### git status
```bash
# show status and what to do
git status
```
notes:
- important git command
- shows a lot of information
- shows basic git commands
- later, we'll see different outputs
</section>
<section id="internals-staging-area" data-markdown>
## internals
### the staging area
![staging area](img/staging-area.svg)
</section>
<section id="cli-git-files" data-markdown>
## command line
### file handling
```bash
# use staging area
git stage file
git unstage file
# discard changes
git checkout file
# rename and remove
git mv source destination
git rm file
```
</section>
<section id="cli-git-diff-1" data-markdown>
## command line
### show changes
```bash
# from staging area to current working copy
git diff
# show contents of staging area, i.e.
# from last commit to staging area
git diff --staged
```
</section>
<section id="cli-git-commit" data-markdown>
## command line
### commit changes
```bash
# opens editor for you to edit commit message
git commit
# commits with a short message
git commit -m 'adds license and readme'
```
</section>
<section id="commit-message-conventions" data-markdown>
## TODO
</section>
<section id="cli-git-log" data-markdown>
## command line
### view history
```bash
# show all commits
git log
<section id="demo" data-markdown> # show all commits plus diff
## my project git log --patch
demo # shows condensed view of history, i.e.
# - only commit message subjects
# - one per line
git lol
```
</section>
<section id="cli-demo-basic" data-markdown>
## demo
### basic commands
notes: notes:
- mkdir ~/projects
- git init hello - git init hello
- README.md - README.md
- LICENSE - LICENSE
- TODO really talk about licenses? I should, because it's
important, but it takes time away from other things ...
- src/hello.py - src/hello.py
</section> </section>
<section id="licenses-software" data-markdown>
## software licenses
![software licenses](img/license-chooser.svg)
https://choosealicense.com
</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
https://choosealicense.com
</section>
<section id="licenses-other" data-markdown>
## other licenses
- 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!
notes:
- deputize those who already have
</section>
</section>
<section id="break" data-markdown>
# break
</section>
<!---------------------------------------------------------------------
<!-- distributed
<!-------------------------------------------------------------------->
<section>
<section id="distributed" data-markdown>
# distributed
## version control system
</section>
<section id="distributed-local" data-markdown>
## git usage until now
- has all been local
- repo contains entire project history
- not yet answered:
- how to publish?
- how to contribute?
</section>
<section id="distributed-remotes" data-markdown>
## remotes
![remotes](img/git-remote-solo.svg)
</section>
<section id="distributed-webapps" data-markdown>
### how do i get remotes?
# web apps
- GitLab demo
- GitHub (no demo)
</section>
<section id="distributed-remote-clone" data-markdown>
## command line
### clone repositories
```bash
# create local copy of existing repository
git clone https://github.com/user/project-name.git
```
</section>
<section id="distributed-your-turn" data-markdown>
## your turn
- log in
- create project
- fetch / push / pull
</section>
</section> </section>
<section id="webapps" data-markdown> <!---------------------------------------------------------------------
## web apps <!-- collaboration
<!-------------------------------------------------------------------->
- GitHub demo <section>
- GitLab demo <section id="collab" data-markdown>
# collaboration
</section>
<section id="collab-" data-markdown>
## command line
### git
```bash
```
</section>
<section id="collab-" data-markdown>
## command line
### git
```bash
```
</section>
</section>
<section>
<section id="homework" data-markdown>
# homework
</section>
<section id="homework-use-git" data-markdown>
## homework #1
### use git
for each project you use ...
... create repository in GitLab ...
... and commit changes!
</section>
<section id="homework-collaborate" data-markdown>
## homework #2
### collaborate
- talk with your colleagues
- organize project(s) you use together
- open issues for problems and features
- contribute via merge requests
- review commits and merge requests
</section>
<section id="homework-behavior" data-markdown>
## homework #3
be friendly
be responsible
be open
be creative
be proactive
have fun
</section>
</section> </section>
<section id="eof" data-background="img/trex.png"> <section id="eof" data-background="img/trex.png">
......
SOURCES_DOT = $(wildcard *.dot) SOURCES_DOT = $(wildcard *.dot)
default: all
OBJECTS_DOT_SVG = $(SOURCES_DOT:.dot=.svg) OBJECTS_DOT_SVG = $(SOURCES_DOT:.dot=.svg)
OBJECTS = \ OBJECTS = \
...@@ -15,8 +17,6 @@ all: $(OBJECTS) ...@@ -15,8 +17,6 @@ all: $(OBJECTS)
clean: clean:
rm -f $(OBJECTS) rm -f $(OBJECTS)
default: all
.PHONY: \ .PHONY: \
all \ all \
clean \ clean \
......
digraph {
compound = true
node [shape = "box", style = "filled, rounded"]
nodesep = 0.5
ranksep = 1.5
subgraph clusterorigin {
label = "origin"
node [color = orchid]
omaster[label = "master"]
}
subgraph clusterlocal {
label = "local"
node [color = orchid]
master[label = "master"]
}
omaster -> master [label = "git fetch", style = dotted, ltail = clusterorigin, lhead = clusterlocal]
master -> omaster [label = "git push"]
omaster -> master [label = "git pull"]
}
digraph {
node [shape = "diamond"]
q1[label = "how open?"]
q2[label = "patents?"]
q3[label = "commercial\nadoption?"]
node [shape = "box", style = "filled"]
a1a[label = "put software out there"]
a1b[label = "others should share too"]
a2a[label = "anyone can use the patents"]
a2b[label = "keep the rights to my patents"]
a3a[label = "code can be used in closed source"]
a3b[label = "others should share too"]
node [color = limegreen]
s1[label = "permissive license"]
s2[label = "copyleft license"]
node [color = orchid]
l1[label = "Apache"]
l2[label = "MIT / BSD"]
l3[label = "LGPL"]
l4[label = "GPL"]
q1 -> a1a -> s1 -> q2
q1 -> a1b -> s2 -> q3
q2 -> a2a -> l1
q2 -> a2b -> l2
q3 -> a3a -> l3
q3 -> a3b -> l4
}
digraph {
node [shape = "box", style = "filled,rounded"]
# untracked[label = "untracked\n(files git doesn't know)"]
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]
# discard[label = "discard\n(remove file)"]
# untracked -> stage [label = "git add"]
# stage -> untracked [label = "git unstage"]
workdir -> stage [label = "git stage file"]
stage -> workdir [label = "git unstage file"]
# workdir -> discard [label = "git checkout"]
# untracked -> discard [label = "rm"]
stage -> repo [label = "git commit"]
# { rank = same; untracked workdir }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment