Skip to content
Snippets Groups Projects
Verified Commit 1926e63c authored by nfontrod's avatar nfontrod
Browse files

slides/slides.qmd slides/style.css: update

parent 4fc6cb07
Branches
No related tags found
No related merge requests found
...@@ -2,9 +2,12 @@ ...@@ -2,9 +2,12 @@
title: "Git Borg Linker" title: "Git Borg Linker"
subtitle: "Incremental backup of your results folder with git and borg" subtitle: "Incremental backup of your results folder with git and borg"
author: "Nicolas Fontrodona" author: "Nicolas Fontrodona"
institute: "LBMC -- ENS" institute: "LBMC -- ENS<br>"
date: "`r format(Sys.time(), '%d/%m/%y')`" date: last-modified
date-format: full
toc: true toc: true
mainfont: calibri
monofont: Source Code Pro
format: format:
revealjs: revealjs:
center: false center: false
...@@ -316,9 +319,9 @@ The `gblk list` command lists all backups inside the `.borg` folder ...@@ -316,9 +319,9 @@ The `gblk list` command lists all backups inside the `.borg` folder
```bash ```bash
$ gblk list $ gblk list
b1da0e305c906fb242bc8... Mon, 2022-06-13 15:47:24 [2960...] df0eb55ce43fa48b652340183b5f9cc69daa2350 Fri, 2023-02-10 16:15:56 [c9409...]
$ git rev-parse --verify HEAD # Show current commit $ git rev-parse --verify HEAD # Show current commit
b1da0e305c906fb242bc8... df0eb55ce43fa48b652340183b5f9cc69daa2350
``` ```
<br> <br>
...@@ -380,5 +383,61 @@ Will revert *both your code and your results* as they were. The workflow is the ...@@ -380,5 +383,61 @@ Will revert *both your code and your results* as they were. The workflow is the
- `git checkout SOURCE_COMMIT`: Going back to the state before the step 1 - `git checkout SOURCE_COMMIT`: Going back to the state before the step 1
- `gblk pre-co`: checks if there is no new data inside the results folder otherwize it stops the checkout. - `gblk pre-co`: checks if there is no new data inside the results folder otherwize it stops the checkout.
- `git checkout DESTINATION_COMMIT` - `git checkout DESTINATION_COMMIT`
- `gblk checkout --mode hard`: hard is the default mode used when hooks are created. With hard mode, the results folder is completly deleted, this action is skipped if with --mode soft. Then the backup of the first commit is extracted into the results folder. - `gblk checkout --mode hard`: *hard* is the default mode used when hooks are created. With hard mode, the *results folder is completly deleted*, this action is skipped if with `--mode soft`. Then the backup of the first commit is extracted into the results folder. `--mode soft` can lead to have a `results` folder with *both old and new files*. It usage is **not recommended**.
::: :::
## Git Borg Linker - checkout {.unnumbered .unlisted}
Let's go back to our example project (in slide 11, 14, 15 and 17):
In this project, we're using *hooks*:
```bash
$ echo "echo 'a newline' >> results/result.txt" >> src/script.sh # Add anew line into result.txt file
$ bash src/script.sh # Execute the script
$ cat results/result.txt # display the new content of the file
result line
a newline
$ git add src/script.sh && git commit -m "src/script.sh: update"
...
$ git co df0eb55ce43fa48b652340183b5f9cc69daa2350 # checkout to the first commit, gblk checkout is executed after that command
...
HEAD est maintenant sur df0eb55 src/script.sh: initial commit
$ cat results/result.txt
result line
$ git co master
Basculement sur la branche 'master'
$ cat results/result.txt
result line
a newline
```
## Git Borg Linker - checkout {.unnumbered .unlisted}
Example with unsaved results in our results folder:
```bash
$ echo "test" >> results/result.txt
$ echo "new files" > results/new.txt
$ git co df0eb55ce43fa48b652340183b5f9cc69daa2350
+27 B -22 B results/result.txt
added 10 B results/new.txt
Your results folder contains unsaved changes!
Please update your current commit with: gblk commit --update
Or revert it back to it's previous state with gblk commit --revert
```
Usaved changes are detected, you can:
- discard unsaved changes with `gblk commit --revert`
- update the current archive with the new content inside the results folder with `gblk commit --update`
\ No newline at end of file
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
border-radius: 5px; border-radius: 5px;
background-color: rgb(214, 214, 214); background-color: rgb(214, 214, 214);
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
font-family: monospace;
font-size: 0.9em; font-size: 0.9em;
} }
...@@ -81,7 +80,6 @@ ...@@ -81,7 +80,6 @@
border-radius: 5px; border-radius: 5px;
background-color: rgb(214, 214, 214); background-color: rgb(214, 214, 214);
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
font-family: monospace;
font-size: 0.9em; font-size: 0.9em;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment