Principally mathlib uses the fork-and-branch workflow. See https://blog.scottlowe.org/2015/01/27/using-fork-branch-git-workflow/ for a good introduction.
Here are some tips and tricks to make the process of contributing as smooth as possible.
- Use Zulip: https://leanprover.zulipchat.com/ Discuss your contribution while you are working on it.
- Adhere to the guidelines:
- The style guide for contributors.
- The explanation of naming conventions.
- The git commit conventions.
- Create a pull request from a feature branch on your personal fork, as explained in the link above, or from a branch of the main repository if you have commit access (you can ask for access on Zulip).
Finally, https://github.com/leanprover-community/mathlib-nursery makes it possible to have early access to work in progress. See its README for more details.