General commands

Force pull

git fetch origin
git reset --hard origin/main

Stash changes

1. Stash your changes


git stash push -m "My local changes"

Now your working directory is clean.


2. Pull the latest code (optional but recommended)


git pull origin main

3. Push your branch


git push origin main

4. Re-apply your stashed changes (if you want them back)


git stash pop




Revision #3
Created 16 August 2025 05:09:59 by Conor
Updated 29 August 2025 11:01:14 by Conor