import { syntaxHighlighter, swiss } from 'mdx-deck/themes' import { Invert, Split, SplitRight, Horizontal, FullScreenCode, Image } from 'mdx-deck' import customTheme from './theme' import Layout from './components/layout'
export const themes = [syntaxHighlighter, swiss, customTheme]
import hero from './images/hero.jpg'
<Image src={hero} style={{ width: '100vw', height: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
import git from './images/git.svg' import avatar from './images/avatar.jpg' import { Image as Avatar } from 'rebass'
<Avatar src={avatar} sx={{ width: 200, height: 200, borderRadius: 9999, }} />
@maartenlouage
- Configuration
- .gitattributes
- Submodules
- Hooks
- Bisect
Evaluated from the repository up
- local (repository/.git/config)
- global (/home/maarten/.gitconfig)
- system (/etc/git/gitconfig)
Edit a specific level
git config --global -e
Normalize the line endings
* text=auto
Usually the better option then relying on
git config --global core.autocrlf true
Diffing binary files
*.jpg diff=exif
*.jpeg diff=exif
git config --global diff.exif.textconv exiftool
Remove files from export
yarn.lock export-ignore
.gitignore export-ignore
.gitattributes export-ignore
Default decisions on merge
yarn.lock merge=ours
package-lock.json merge=ours
A construct within Git that enables you to keep a separate Git repository as a subdirectory within an existing repository. This effectively keeps two separate repositories linked together within a project.
Submodules are not the only way to manage dependencies in Git. An alternative is subtree. Subtree is seen as less complex than submodules.
If the dependencies get really complex or the project is big, managing the dependencies through Git is often not the best solution. Try real package managers like nuget, npm, pip, ...
If you need to maintain a strict version management over your external dependencies.
- When an external component or subproject is changing too fast or upcoming changes will break the API, you can lock the code to a specific commit.
- When you have a component that isn’t updated very often and you want to track it as a vendor dependency.
- When you are delegating a piece of the project to a third party and you want to integrate their work at a specific time or release.
git config --global status.submoduleSummary true
git config --global push.recursiveSubmodules on-demand
git pull
git submodule sync --recursive
git submodule update --init --recursive
import hooks from './images/hooks_medium.png'
Git hooks are scripts that run automatically every time a particular event occurs in a Git repository. They let you customize Git’s internal behavior and trigger customizable actions at key points in the development life cycle.
All of the local hooks can be altered or completely uninstalled by the owner of a repository. It’s entirely up to each team member whether or not they actually use a hook. With this in mind, it’s best to think of Git hooks as a convenient developer tool rather than a strictly enforced development policy.
It is possible to reject commits that do not conform to some standard using server-side hooks.
Bisect comes from a binary search algorithm and it’s an efficient way to search through a large set of data. By repetitively dividing the batch in half and performing some kind of validation check, we are able to scan through a huge amount of data in a limited number of iterations. Bisect could be performed manually, by simply "checking out" to a specific commit and looking through the code.
git bisect
git bisect bad
git bisect good <SHA1>
git bisect bad/good
git bisect reset