Git best practices
On this page
Small commits let reviewers inspect one change at a time. A shared branching workflow tells contributors where to open pull requests and how to merge them.
Interactive presentation
Use Previous and Next to move through the presentation, or choose a slide from the menu. You can also focus the presentation and use the Left and Right arrow keys. Fullscreen enlarges the slides without changing their proportions. Show all slides displays the complete deck.
Loading the presentation.
Key takeaways
The presentation covers these practices:
- Write commit messages that explain the change and keep unrelated changes in separate commits.
- Choose a branching workflow that matches your team’s review and release process.
- Resolve merge conflicts and check the result before continuing.
- Use Git hooks and code reviews to check changes before merging.
- Check whether a change has been shared before choosing how to undo it.
Agree on team conventions
Agree on branch names, commit messages, and merge rules with your team. Use those conventions in pull requests so reviewers can follow a change through the project’s history.