How to Not 🌋 your Project

Fri, 29 Jan 2021 01:00:00 -0000

Talk Slides

Definition

Volcano - Take a small issue in git and have it erupt into a massive issue.

Example 1

WHAT YOU SHOULD NEVER DO

"Me: Now to add these 2 days of code to GitHub.
git add .
whoops I added environment vars lets just revert..."

2 days of work pic.twitter.com/346grNXfUz
— Jay Miller - #BlackLivesMatter (@kjaymiller) January 16, 2021

How to solve this problem

[.column]

If you pushed to github.

Sorry gonna have to delete that repo in GH. To really clean the history.

[.column]

If you didn't...

rm -rf .git
git init

Example 2

Who just spent the last 3 hours trying to squash a commit (I accidentally uploaded some CSV files and it's making the pulls take much longer and they are unnecessary)

The same person that couldn't get it to work. That person.. pic.twitter.com/ezIIlCYJmw
— Jay Miller - #BlackLivesMatter (@kjaymiller) December 14, 2020

via @anthonypjshaw

git rebase -i

commit hash before the one you want to drop

Preventative Measures

DON'T LOAD EVERYTHING AT ONCE

git commit <filenames> -m 'update to specific piece of code'

Bonus Points to IDEs - Tower - GitHub - PyCharm - VSCode

Before Doing Anything ⚠️

git template or git script

npx gitignore python
echo .envrc >> .gitignore
echo node_modules >> .gitignore
echo *.json *.csv >> .gitignore

No git add .

git status before you git wrecked