Skip to content
Snippets Groups Projects
Verified Commit d661effa authored by Lukas Kluft's avatar Lukas Kluft
Browse files

Add motivation and first steps

parent 0f8212ea
No related branches found
No related tags found
No related merge requests found
......@@ -4,24 +4,60 @@ subtitle: "A Brief Introduction into Git"
author: "Lukas Kluft and Georgiana Mania"
---
## What is git?
(2-3 slides - Lukas)
## Version control systems
* why is it useful?
* main concepts: local vs remote repository, history,
* web interfaces : GitHub, GitLab, BitBucket
There are many version control systems out there (e.g. Subversion, CVS, Mercurial). We will focus on [Git](http://git-scm.com) which is the **de facto standard**
## Get Started
![](https://git-scm.com/images/logos/downloads/Git-Logo-2Color.svg "Git logo"){height=10%}
(local repo only - 7-8 slide (commands & expl - Lukas)
## Why version control?
* setup configs (username, email)
* create repository from local sources (git add, git commit, git push)
* basic commands: git log, git diff, git status, check commit history
::: {.incremental}
* **Exchange** _I'll send you my script via mail._
* **Collaboration** _Sample File (conflicted copy 2019-11-21)_
* **Storing versions** (properly) _But it worked yesterday..._ 😭
* **Tracking** _I did not change anything!!11!_ 🤬
* **Backup** _I replaced the wrong my_file_2_final_final.py_ 😱
:::
## As easy as **1, 2, 3**
```bash
git init . # Initialize a repository
git add . # Add the whole directory content
git commit -m "Initial commit" # Commit your changes
```
## The basic workflow
* Git offers plenty of functionality that is extensively documented
* You will only need a **handful of commands** in your day to day work:
```bash
git status # show which files have changed
git diff my_file # show what has changed
git add my_file # stage changes
git commit # commit your changes
```
## Configuration
* Each commit is attributed to an author
* The concept or authorship is heaviy used on other platforms (e.g. GitLab)
```bash
git config --global user.name "Your Name"
git config --global user.email "youremail@yourdomain.com"
```
# Hands-on Session! {background-color=var(--dark-bg-color)}
1. Configure the username and email adress in your local git client
2. Initializse an empty Git repository
3. Create a file and add it to the repo
3. Change the file, inspect the differences, and commit the changes
## Branches
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment