Stop Using git checkout
Git 2.23 introduced two commands that replace the two different jobs git checkout used to do: git switch — change or create…
Pulling changes from the main branch into your feature branch is a common task before pushing changes and creating a pull request/merge request.
Note: This guide uses "main" as the primary branch name, which is common on GitHub. Some repositories or other hosting services might use "master" instead. Adjust commands as necessary for your specific setup.
Save your current work:
git stash save "Work in progress"
Fetch the latest changes:
git fetch origin
Update the main branch locally:
git checkout main
git pull origin main
Switch back to your feature branch:
git checkout feature/your-branch-name
Merge or rebase with main:
Option A - Merge (simpler, preserves history):
git merge main
Option B - Rebase (cleaner history, requires force push if branch is shared):
git rebase main
Resolve any conflicts (if they occur):
git status to see conflicting filesgit add the resolved filesgit merge --continuegit rebase --continueReapply your stashed changes:
git stash pop
Test your changes thoroughly
Push your updated feature branch:
git push origin feature/your-branch-name
(Use --force-with-lease if you rebased and the branch was already pushed)
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com