📥 Different Ways of Pulling Updates from Remote

Keeping your local branch in sync with the remote ensures you’re working with the latest code. Below are common ways to do it — starting from safest to most destructive.


✅ Safe / Common Methods

1. git pull

git pull origin main

2. git fetch + git merge

git fetch origin main
git merge origin/main

3. git fetch + git rebase

git fetch origin main
git rebase origin/main

3b. git pull --rebase

git pull --rebase origin main
git fetch origin main
git rebase origin/main

📦 Starting Fresh

4. git clone

git clone https://github.com/username/repo-name.git

⚠️ Risky / Destructive

5. git reset --hard origin/main

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