Pull Updates
Keep your Plainform project up to date with the latest features and fixes
Plainform periodically releases updates with new features, bug fixes, and improvements. This guide shows you how to safely sync your project with the upstream repository while preserving your customizations.
Always pull updates into a new branch first to avoid disrupting your main codebase. This allows you to test changes before merging.
Prerequisites
- Git installed and configured
- Your Plainform project initialized as a Git repository
- Your custom code committed to your own repository
- Working tree clean before starting (
git statusshows no uncommitted changes) - Basic understanding of Git branching and merging
Overview
Keeping your project synchronized with upstream updates ensures you benefit from the latest improvements while maintaining your custom features. The process involves adding the upstream repository as a remote, fetching updates, resolving any conflicts, and merging changes into your main branch.
Step-by-Step Guide
Set Up the Upstream Repository
Add the Plainform repository as a remote to pull updates from. This only needs to be done once per project.
git remote add upstream https://github.com/GeluHorotan/plainform-essentials.gitVerify the remote was added successfully:
git remote -vYou should see both origin (your repository) and upstream (Plainform repository) listed.
Create a New Branch for Updates
Start from your current main branch, make sure it is up to date, then create a dedicated update branch:
git switch main
git pull origin main
git switch -c update/plainform-latestNever pull updates directly into your main branch. Always use a separate branch to test changes first.
Fetch and Merge Updates
Fetch the latest changes from the upstream repository:
git fetch upstream mainMerge the updates from the upstream main branch:
git merge upstream/mainThis pulls the latest commits from Plainform into your update branch.
Resolve Merge Conflicts
If your project has customizations, merge conflicts may occur. Git will pause the merge and mark conflicting files.
To resolve conflicts:
- Open the affected files in your code editor (VS Code will highlight conflicts)
- Look for conflict markers:
<<<<<<<,=======, and>>>>>>> - Review each conflict and decide which changes to keep
- Remove the conflict markers after resolving
- Mark files as resolved:
git add <file-name>- Complete the merge:
git commitCommon conflict areas include app/, components/, config/, and package.json. Take care to preserve your customizations while integrating updates.
Test Your Application
Before merging into main, install dependency changes, apply any new migrations, and run the project checks:
npm installnpx prisma migrate devnpm run lint
npm run buildThen start the app locally and test key functionality, including authentication flows, payment processing, custom features you've added, Supabase/Prisma database access, and any routes affected by merge conflicts.
npm run devVisit http://localhost:3000 and verify the app manually.
Merge Updates into Main Branch
Once conflicts are resolved and testing is complete, merge the updates into your main branch:
git switch maingit merge update/plainform-latestPush the updated main branch to your repository:
git push origin mainClean Up
Delete the update branch if no longer needed:
git branch -d update/plainform-latestIf you've already pushed the branch to your remote:
git push origin --delete update/plainform-latestBest Practices
Before Pulling Updates
- Backup Your Work: Commit or stash all uncommitted changes to avoid losing work
- Check Release Notes: Review Plainform release notes to understand what's changing
- Check Required Env Vars: Compare your
.env/ hosting variables with the latest.env.example - Check Migrations: Review new files in
prisma/migrationsbefore applying them - Plan for Downtime: Schedule updates during low-traffic periods if running in production
During the Update Process
- Read Conflict Carefully: Don't blindly accept all incoming or current changes
- Test Incrementally: After resolving each major conflict, test the affected functionality
- Keep Dependencies Updated: Run
npm installafter merging to update dependencies - Review Generated Files: Do not commit
.next,.source,lib/generated/prisma, sitemap files, or local.envfiles
After Merging
- Run Full Test Suite: Test all critical paths in your application
- Check Environment Variables: Verify if new environment variables are required
- Apply Production Migrations: Run
npx prisma migrate deployduring deployment if migrations changed - Update Documentation: Document any breaking changes that affect your team
- Monitor Production: Watch for errors after deploying updated code
Troubleshooting
Alternative: Using Git Rebase
For a cleaner commit history, advanced Git users can rebase their update branch instead of merging:
git switch update/plainform-latest
git rebase upstream/mainOnly use rebase if you understand the conflict workflow and have not pushed the branch to a shared repository. Rebasing rewrites history and can cause issues for collaborators.
Related Resources
Installation Guide
Set up your Plainform project from scratch
Project Structure
Understand the folder organization
Git Workflow
Learn about branching and commit conventions
Official Git Docs
Git documentation for advanced topics
Next Steps
- Configure your IDE for optimal development
- Set up environment variables for your project
- Learn about the architecture to understand the codebase
How is this guide ?
Last updated on