runrig-coop / early-warning-system

An early warning system for Richland Gro-Op to coordinate field health.
GNU General Public License v3.0
2 stars 1 forks source link

Remove node_modules from git history :warning: HARD RESET REQUIRED!!! :warning: #14

Closed jgaehring closed 1 year ago

jgaehring commented 1 year ago

Normally I'd always advise against force-pushing to main, but I thought while we're early on in the project, it might be good to rewrite the history so those early commits that include the node_modules directory and its contents (400+ files, some of which might've been binaries) get dropped from the history entirely and don't add unnecessary bytes to .git/refs for anyone cloning the repo in the future.

This would require anyone who's already cloned the repo to do a hard reset of their local main, which is why I'd never suggest this otherwise, but since we're not very far along and to my knowledge it's just the 3 of us who've cloned it so far, seems acceptable. It should just require the following to correct your locals:

git fetch origin main
git reset --hard origin/main

Thoughts?

I'm requesting your reviews, but assuming you approve, don't merge here through the GitHub GUI. I'll manually force-push to main to "merge".

jgaehring commented 1 year ago

And just to clarify, the git commands I suggested above would need to be done after I force pushed.

jgaehring commented 1 year ago

Ok, about to force-push now, so you'll need to do a hard reset of main afterwards.

jgaehring commented 1 year ago

Oh, and it's probably a good idea to delete node_modules and run a fresh install w/ npm i after resetting main.

jgaehring commented 1 year ago

Oh, and last thing, I swear... Just added branch protections to the main branch to prohibit force-pushing in the future, although we can always turn that off or reconfigure it if we get into a pinch.