website/content/en/docs/dev/git.md
To combine multiple commits into one (recommended unless your PR covers multiple topics):
# Adjust the number based on how many commits you want to squash
git rebase -i HEAD~3
In the interactive editor that appears:
pickpick to fixup (short formf). You may also choose squash (s), however, fixup is recommended to keep the commit message clean.Example:
pick aaaaaaa First commit message
pick bbbbbbb Second commit message
pick ccccccc Fix typo
To:
pick aaaaaaa First commit message
f bbbbbbb Second commit message
f ccccccc Fix typo
To update your branch with the latest changes from upstream:
git remote add upstream https://github.com/lima-vm/lima.git # Only needed once
git fetch upstream
git rebase upstream/master
If you encounter issues during rebase:
git rebase --abort # Cancel the rebase and return to original state
git status # Check current state
For merge conflicts during rebase:
git add the resolved filesgit rebase --continue