A common flow when collaborating:
- Sync main
- git switch main
- git fetch origin
- git pull —rebase # keep a linear history (optional)
- Create a feature branch
- git switch -c feature/awesome
- Work and commit
- git add -p
- git commit -m “Implement awesome”
- Update your branch with latest main
- git fetch origin
- git rebase origin/main # or: git merge origin/main
- Push and open a PR
- git push -u origin feature/awesome
- Open a Pull Request on your hosting platform
Checklist
- You can sync main before branching
- You can rebase or merge main into your branch
- You can push and open a PR