Skip to content
Snippets Groups Projects
Verified Commit 6811530e authored by Georgiana Mania's avatar Georgiana Mania Committed by Lukas Kluft
Browse files

reuse layout from first lecture

parent 08505cd8
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ website:
# - "lectures/example-lecture/slides.qmd"
- "lectures/intro/slides.qmd"
- "lectures/command-line/slides.qmd"
# - "lectures/git/slides.qmd"
- "lectures/git/slides.qmd"
# - "lectures/programming-paradigms/slides.qmd"
# - "lectures/data-structures/slides.qmd"
# - "lectures/complexity/slides.qmd"
......
---
title: "Git"
subtitle: "A Brief Introduction into Git"
author: "Lukas, Georgiana, Theresa, Tobi"
author: "Lukas Kluft and Georgiana Mania"
---
## What is git?
......@@ -12,24 +12,25 @@ author: "Lukas, Georgiana, Theresa, Tobi"
* main concepts: local vs remote repository, history,
* web interfaces : GitHub, GitLab, BitBucket
## Get started
## Get Started
(local repo only - 7-8 slide (commands & expl - Lukas)
* 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
* stop lecture: do exercises
# Hands-on Session! {background-color=var(--dark-bg-color)}
## Branches
* are versions of the code identified with a name (besides existing hash)
* are used to encapsulate the changes required for a new feature or a bugfix
* allow incremental development without impacting the `main` branch
* allow incremental development without impacting the `master` branch
---
### Create a branch
## Create a Branch
```bash
# check the branches before creating a new one
git branch
......@@ -44,9 +45,7 @@ git branch
* master
```
---
### Switch branches
## Switch Branches
```bash
# check the branches to see the current branch
git branch
......@@ -62,9 +61,7 @@ git branch
master
```
---
### Rename a branch
## Rename a Branch
```bash
# check the branches before rename
......@@ -81,9 +78,7 @@ git branch
master
```
---
### Compare branches
## Compare Branches
```bash
git diff master..feature-new-sorting-algo
......@@ -97,9 +92,7 @@ index faab00e..f4ecce0 100644
```
---
### Rebase a branch
## Rebase a Branch
```bash
# make changes in two branches
...
......@@ -117,9 +110,7 @@ Could not apply 2ce7874... modify in branch
```
---
### Rebase a branch - edit conflicts
## Rebase a Branch - Edit Conflicts
```bash
# view and edit the conflicting file
<<<<<<< HEAD
......@@ -136,10 +127,7 @@ git rebase --continue
Successfully rebased and updated refs/heads/feature-new-sorting-algo.
```
---
### Merge a branch
## Merge a Branch
```bash
# move to destination branch
git checkout master
......@@ -152,9 +140,7 @@ Fast-forward
1 file changed, 1 insertion(+), 1 deletion(-)
```
---
### Delete a branch
## Delete a Branch
```bash
# check current branches
git branch
......@@ -169,9 +155,7 @@ git branch
* master
```
---
### Exercise time!
# Hands-on Session! {background-color=var(--dark-bg-color)}
1. create a branch
2. rename the branch
......@@ -180,7 +164,6 @@ git branch
5. check the log for the master branch
6. delete the new branch
---
## Best practices
......
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