Skip to main content

Section 8.1 Terminal Cheat Sheet

Note ID: 202604120002 | Tags: git bash terminal

Subsection 8.1.1 Local Git Reset

Multiline version (safter, less likely to accidentally earase local changes):
git fetch origin
git checkout main        # or whatever branch you're using
git reset --hard origin/main
git clean -fd            # removes untracked files & folders
One-liner (⚠️ use with caution!):
git fetch origin && git reset --hard origin/main && git clean -fd

Subsection 8.1.2 Update pip requirements.txt

pip install -r requirements.txt --upgrade
pip freeze > requirements.txt