Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 1.46 KB

File metadata and controls

68 lines (50 loc) · 1.46 KB

How to Sync Your Fork with Latest Changes

When your instructor makes updates to the original repository, follow these steps to get the latest changes in your forked repository.

First Time Setup (Only do this once)

Add the original repository as an "upstream" remote:

git remote add upstream https://github.com/osazeejedi/javascript-test.git

Every Time You Want to Sync with Latest Changes

  1. Fetch the latest changes from the original repository:

    git fetch upstream
  2. Switch to your main branch:

    git checkout main
  3. Merge the latest changes:

    git merge upstream/main
  4. Push the updates to your fork:

    git push origin main

Alternative: Single Command Method

If you're already on the main branch, you can use:

git pull upstream main

Then push to your fork:

git push origin main

Quick Reference

Complete workflow in one go:

git fetch upstream
git checkout main
git merge upstream/main
git push origin main

Troubleshooting

  • If you get merge conflicts, resolve them in your code editor, then commit the changes
  • If you're unsure which branch you're on, use git branch to check
  • If you need to see your remotes, use git remote -v

Remember:

  • upstream = the original repository (instructor's repo)
  • origin = your forked repository
  • Always sync before starting new work to avoid conflicts