🚀 Keeping Your Fork Up-to-Date
A clean step-by-step guide to sync with the upstream repo while safely making your own changes
-
📡 Add the upstream remote (you've already done this ✅)
git remote add upstream https://github.com/danny-avila/LibreChat.git -
🌿 Create a development branch for your changes
Never work directly onmain— keep it clean for upstream sync.git checkout -b dev
# or name it anything: feature/my-cool-thing, development, etc. -
🔄 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/mainRebase keeps history linear and clean ✨
-
📤 Update your fork on GitHub
git push origin main -
🔀 Bring upstream changes into your dev branch
git checkout dev
git rebase mainNow your development branch has all the latest upstream updates
-
💾 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.
.jpg)
Comments
Post a Comment