A common flow when collaborating:

  1. Sync main
  • git switch main
  • git fetch origin
  • git pull —rebase # keep a linear history (optional)
  1. Create a feature branch
  • git switch -c feature/awesome
  1. Work and commit
  • git add -p
  • git commit -m “Implement awesome”
  1. Update your branch with latest main
  • git fetch origin
  • git rebase origin/main # or: git merge origin/main
  1. 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