Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture materials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Marius Rixen
lecture materials
Commits
6811530e
Verified
Commit
6811530e
authored
1 year ago
by
Georgiana Mania
Committed by
Lukas Kluft
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
reuse layout from first lecture
parent
08505cd8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_quarto.yml
+1
-1
1 addition, 1 deletion
_quarto.yml
lectures/git/slides.qmd
+15
-32
15 additions, 32 deletions
lectures/git/slides.qmd
with
16 additions
and
33 deletions
_quarto.yml
+
1
−
1
View file @
6811530e
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
lectures/
02-G
it/slides.qmd
→
lectures/
g
it/slides.qmd
+
15
−
32
View file @
6811530e
---
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
s
tarted
## Get
S
tarted
(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 `ma
in
` branch
* allow incremental development without impacting the `ma
ster
` branch
---
##
#
Create a
b
ranch
## Create a
B
ranch
```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
...
...
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