Lecturer: Michael Lydeamore
Department of Econometrics and Business Statistics
Aim
git
project from an existing local foldergit blame
Suppose you have a folder on your computer which is not version controlled, and you decide that you would like to start tracking it.
You go to GitHub and create a repo over there. You now have two options:
git init
to create a git
repostiroygit remote add origin git@github.com:...
git push -u origin main
Option 2 is preferred because it reduces duplication.
GitHub even gives you instructions:
The -u
flag says to link remote origin
to branch main
. it is a one time operation.
Remember you can verify your remotes using git remote -v
Public repos in GitHub make your work publicly available and therefore it is important to establish how your work should be acknowledged if someone else wants to use it.
Public repositories on GitHub are often used to share open source software. For your repository to be truly open source, you’ll need to license it sot that others are free to use, change and distribute the software.
You can add a license by:
Licenses go in the root of the directory. Some information about licenses is sometimes included in README.md
as well, but this is not required.
git blame
?git blame
useful?It’s about understanding, not accusing!
3f23c8d2 (Alice Smith 2024-03-01 12:03:45 +0000 1) x <- 1
ed32fa01 (Bob Jones 2024-03-02 09:15:23 +0000 2) y <- x + 1
af9345dd (Charlie Liu 2024-03-03 16:42:07 +0000 3) print(y)
git show <commit>
to see the full commit diffgit log -L
to follow changes to a specific function or rangegit bisect
for deeper history analysisgit bisect
?git bisect
?o---o---o---o---o---o---o
G ? ? B
G
: Good commit (known to be bug-free)B
: Bad commit (where bug is present)?
) and narrows down.git bisect start
git bisect bad # current commit is buggy
git bisect good <commit-id> # known good commit
Git now checks out a middle commit. At each step, you say:
Git will show something like:
3f9a2d1a is the first bad commit
Author: Charlie <charlie@example.com>
Then, clean up with:
Where test.R
returns:
This can save time for large projects!
So far we have only look at written guides (like books and documents) in Quarto. Now it is time to learn how to do presentations!
To create slides, use horizontal rules (---
) to separate them:
## Slide Title
Content for this slide
---
## Another Slide
More content
Use different heading levels to create nested slides (vertical stacks):
## Top-level slide
---
### Sub-slide (stacked under the previous)
Useful for going deeper on a topic without changing the horizontal flow.
Use :::
blocks with .fragment
to reveal content piece-by-piece:
- Item 1
::: {.fragment}
- Item 2 (appears next)
:::
::: {.fragment}
- Item 3 (appears after that)
:::
Press space to reveal each in order during the presentation.
You can automatically reveal bullet points one at a time
by setting incremental: true
in your YAML header:
Then, write a normal list:
- First point
- Second point
- Third point
Each list item will appear step-by-step when you present.
Use a .columns
div and .column
blocks inside:
::: columns
::: {.column width="50%"}
Left side content
:::
::: {.column width="50%"}
Right side content
:::
:::
Useful for comparisons, images + text, or two-part layouts.
You can customize the look:
Themes include: simple
, solarized
, beige
, night
, white
, moon
, etc.
Add presenter notes with ???
under the slide:
## Slide Title
Visible content
???
Notes only the presenter can see.
Press ‘s’ during the presentation to open speaker view.
.smaller
classYou can use .smaller
to shrink text size for dense slides or long code blocks.
This slide has .smaller
applied!
.pull-left
/ .pull-right
to align content.qmd
documentsTo render your presentation:
slides.qmd
It will output an HTML presentation. Open it in your browser.
Important
git blame/bisect
ETC5513 Week 9