diff --git a/README.md b/README.md index 0ace033..f1e7b69 100644 --- a/README.md +++ b/README.md @@ -99,3 +99,63 @@ Now submit the pull request. submit pull request Soon I'll be merging all your changes into the master branch of this project. You will get a notification email once the changes have been merged. + +## Keeping Your Fork Up to Date with the Original Repository + +After you fork this repository, the original project may receive new updates. To keep your fork updated with those changes, follow these steps: + +### Option 1: Sync Using GitHub (Without Command Line) + +1. Go to your forked repository on GitHub. +2. Click on the **"Sync fork"** button (if available). +3. Click **"Update branch"** to pull the latest changes from the original repository. + +### Option 2: Sync Using the Compare Feature + +1. Go to your forked repository on GitHub. +2. Click on **"Compare"**. +3. Make sure: + - **Base repository** = Original repository + - **Head repository** = Your fork +4. Create a Pull Request from the original repo to your fork. +5. Merge that Pull Request into your fork to update it. + +> ⚠️ Note: Sometimes the base and head repositories appear **reversed** in the Compare dropdown by default. Always make sure the **original repository is the base** and **your fork is the head** before creating the Pull Request. + +### Option 3: Sync Using the Command Line + +To update your fork using the command line,follow these steps: + +1. Check existing remotes +```bash +git remote -v +``` +2. Add the original repo as upstream (do this only once) +``` +git remote add upstream https://github.com/ORIGINAL_OWNER/REPO_NAME.git +``` +3. Fetch latest changes from original repo +``` +git fetch upstream +``` +4. Switch to main branch (or master) +``` +git checkout main +``` +5. Merge original repo changes into your branch +``` +git merge upstream/main +``` + + 6. Push updated code to your fork on GitHub +``` +git push origin main +``` + +🔁 If your default branch is `master` instead of `main`, replace: + +`main` → `master` +`upstream/main` → `upstream/master` + +This will keep your fork in sync with the original repository so you can continue contributing without conflicts. +