Skip to content

Instantly share code, notes, and snippets.

View TrevorBurnham's full-sized avatar
🍵

Trevor Burnham TrevorBurnham

🍵
View GitHub Profile
@TrevorBurnham
TrevorBurnham / git-good.md
Last active October 24, 2019 12:30
Git Good Practices: A Totally Uncontroversial Guide

Know what changes you're making, every step of the way

Give yourself as many chances as you can to catch your mistakes before you push them:

  1. Use an editor plugin like Sublime Text's GitGutter so you can always see which parts of a file you've changed. (More precisely, it shows the diff of the file between the working directory and HEAD.)
  2. Not sure whether to stage your unstaged changes? Use git diff with no arguments. It shows the difference between your working directory and the index.
  3. Not sure whether to commit your staged changes? Use git diff --staged. It shows the difference between your index and HEAD.
  4. When you decide to commit, use git commit --verbose, no -m, and take one last look at the changes in your editor. (Make sure it's got a nice Git Commit Message syntax, like the one in the Sublime Text Git package, so the list of changes is nice and colorized.) You can't edit the changes directl
@TrevorBurnham
TrevorBurnham / keybindings.json
Created October 7, 2020 19:46
VS Code Custom Keyboard Shortcuts
[
{
"key": "ctrl+t",
"command": "extension.transpose"
},
{
"key": "ctrl+cmd+w",
"command": "workbench.action.closeAllEditors"
},
{
@TrevorBurnham
TrevorBurnham / .eslintignore
Last active June 8, 2023 21:20
Minimal setup for ESLint and Prettier in a TypeScript project
# Add all build artifacts here
build
dist