Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
git-seminar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Scientific Computing
education
git-seminar
Commits
01185a7e
Verified
Commit
01185a7e
authored
6 years ago
by
ck85nori
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
bf914c60
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
basics.html
+200
-66
200 additions, 66 deletions
basics.html
with
200 additions
and
66 deletions
basics.html
+
200
−
66
View file @
01185a7e
...
@@ -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

- **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


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

</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

> 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

</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


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
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment