🚀 Keeping Your Fork Up-to-Date

 


🚀 Keeping Your Fork Up-to-Date

A clean step-by-step guide to sync with the upstream repo while safely making your own changes

  1. 📡 Add the upstream remote (you've already done this ✅)
    git remote add upstream https://github.com/danny-avila/LibreChat.git
  2. 🌿 Create a development branch for your changes
    Never work directly on main — keep it clean for upstream sync. git checkout -b dev
    # or name it anything: feature/my-cool-thing, development, etc.
  3. 🔄 Sync your main branch with upstream (do this regularly) git checkout main
    git fetch upstream
    git rebase upstream/main
    # or if you prefer merge: git merge upstream/main

    Rebase keeps history linear and clean ✨

  4. 📤 Update your fork on GitHub git push origin main
  5. 🔀 Bring upstream changes into your dev branch git checkout dev
    git rebase main

    Now your development branch has all the latest upstream updates

  6. 💾 Commit and push your own changes git add .
    git commit -m "✨ my awesome feature"
    git push origin dev
🔄 Quick daily sync script you can copy-paste: git checkout main
git fetch upstream
git rebase upstream/main
git push origin main
git checkout dev
git rebase main
git push origin dev --force-with-lease # safe force if rebasing

Happy coding! 🚀 Keep your fork fresh and your changes safe.

Comments