| Scenario | What To Do |
|---|---|
You ran git add . and node_modules got staged |
• git reset node_modules/ • Add node_modules/ to .gitignore • git add .gitignore • git commit -m "Fix: removed node_modules" • git push origin main/master |
You ran git commit and node_modules got committed |
• git rm -r --cached node_modules • Add node_modules/ to .gitignore • git commit -m "Remove node_modules" • git push origin main/master |
You ran git push and node_modules is on GitHub |
• git rm -r --cached node_modules • Add node_modules/ to .gitignore • git commit -m "Remove node_modules" • git push origin main --force |
| Scenario | What To Do |
|---|