Skip to content
Snippets Groups Projects

Changes to the slides for the 2022 edition

Merged Mroik requested to merge (removed):edit-2022 into master
Files
3
+ 57
53
@@ -2,9 +2,9 @@
### What we'll talk about:
* Using git repos in a git repo: **submodule**
* Moving a branch 'ahead': **rebase**
* Extracting commits from other branches: **cherry-pick**
* Storing changes for later use: **stash**
* Moving a branch 'ahead': **rebase**
* Finding out who made a mistake: **blame**
----
@@ -25,14 +25,6 @@
## Submodule: What can it do?
A submodule will appear as a subdirectory of our own repository. <!-- .element: class="fragment" -->
Cloning a repository that contains a submodule will not clone it. <!-- .element: class="fragment" -->
---
## Submodule: What can it do?
Once created the sumodule will point always to the same commit. <!-- .element: class="fragment" -->
Every edit we make inside our submodule will not be pushed upstream. <!-- .element: class="fragment" -->
@@ -55,50 +47,6 @@ git submodule update --init --recursive submodule_directory
----
# Moving changes
## Cherry Pick and Stash
![](assets/one-simply-cherry-pick.jpg)
---
## Git Cherry Pick: When do I need it?
<div>
<!-- .element: class="fragment" -->
I need it when I want to import a **single** commit or **a range** of commits from another branch.
</div>
---
## Git Cherry Pick: What can it do?
<div>
<!-- .element: class="fragment" -->
Using **cherry pick**, git will perform a "rebase" (we will see later).
</div>
<div>
<!-- .element: class="fragment" -->
**N.B.** We still need to resolve any conflicts (if needed).
</div>
---
## Git Cherry Pick: Syntax
#### Take a single commit and apply on current branch
```bash
git cherry-pick <commit hash> # single commit form
git cherry-pick <hash start>..<hash end> # commit range form
```
----
## Git Stash
---
@@ -190,6 +138,51 @@ git rebase <branch A name>
----
# Moving changes
## Cherry Pick and Stash
![](assets/one-simply-cherry-pick.jpg)
---
## Git Cherry Pick: When do I need it?
<div>
<!-- .element: class="fragment" -->
I need it when I want to import a **single** commit or **a range** of commits from another branch.
</div>
---
## Git Cherry Pick: What can it do?
<div>
<!-- .element: class="fragment" -->
Using **cherry pick**, git will perform a "rebase" (we will see later).
</div>
<div>
<!-- .element: class="fragment" -->
**N.B.** We still need to resolve any conflicts (if needed).
</div>
---
## Git Cherry Pick: Syntax
#### Take a single commit and apply on current branch
```bash
git cherry-pick <commit hash> # single commit form
git cherry-pick <hash start>..<hash end> # commit range form
```
----
# Who did this?!
## Blame
@@ -235,6 +228,16 @@ What should I use to find a bug if I don't know which lines caused it? <!-- .ele
----
## What does it do?
Does a binary search to find the commit that introduced a bug by flagging a
starting bad commit and a known good commit
To start use **git bisect start**.
Flag a good commit with **git bisect good** and a bad one with **git bisect bad**
----
## Disaster Recovery
### What we'll talk about:
@@ -365,6 +368,7 @@ the ones that are unreachable and the intermediate commits of a rebase
- [__Emanuele Santoro__](http://santoro.tk)
- __Luca Fusé__
- __Giacomo Vercesi__
For their fantastic slides on advanced git topics of the previous years
Loading