Patch Lifecycle
Understanding how patches flow through the Git project helps you write better contributions:Development
You code your changes without needing pre-authorization. Your patches will be reviewed on the mailing list to assess the merit of the idea, design, and implementation.
Submission
Send patches to the mailing list and CC people who may need to know. Your goal is to get help in creating the best solution, not just to convince others.
Review and Iteration
Receive comments and suggestions. Respond with “Reply-All” while preparing updated patches. Polish, refine, and re-send.
Integration (seen branch)
The maintainer may queue patches to the
seen branch for testing. Being in seen does not mean the patch is accepted.Merge to next
When patches reach consensus, they’re included in “What’s cooking” reports marked “Will merge to ‘next’.” This decision is made by the maintainer with reviewer input.
Choosing a Starting Point
Git has four integration branches:- maint - Oldest, for released version fixes
- master - Current development
- next - Topics being tested
- seen - Experimental integration
Which Branch to Use
next and seen are inappropriate starting points. They are frequently re-integrated and force-pushed, making them unsuitable as a base for new work.Making Commits
Separate Logical Changes
Make separate commits for logically separate changes. Always make a commit with a complete commit message rather than generating patches between your working tree and commit head.Commit Message Format
Subject Line:- Maximum 50 characters (soft limit)
- Prefix with “area: ” (e.g.,
doc:,builtin/merge:,refs:) - No period at the end
- First word after prefix is lowercase unless it’s a proper noun
- Use imperative mood: “make xyzzy do frotz” not “makes” or “made”
- Explain the problem the change solves
- Justify why the solution is better
- Note alternate solutions considered but discarded
- Use present tense for the current state: “The code does X” not “used to do”
- Use imperative mood for changes
Commit Reference Format
When referencing other commits, use:Sign-Off Requirement
Developer's Certificate of Origin 1.1
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
- (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
- (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license; or
- (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
- (d) I understand and agree that this project and the contribution are public and that a record of the contribution is maintained indefinitely.
Use a known, distinctive identity. Anonymous contributions cannot be accepted. You may use a pseudonym or preferred name as long as it’s identifying and not misleading.
Additional Trailers
Reported-by:- Credits who found the bugAcked-by:- Someone familiar with the area liked the patchReviewed-by:- Reviewer completely satisfied after detailed analysisTested-by:- Person tested the patch successfullyCo-authored-by:- Multiple people exchanged draftsHelped-by:- Someone suggested ideas for changesSuggested-by:- Someone suggested the idea
Testing
Sending Patches
Using format-patch and send-email
Email Guidelines
Subject prefix conventions:[PATCH]- Normal patch[PATCH v2],[PATCH v3]- Updated versions[RFC PATCH]- Request for comments, needs discussion
Choosing Reviewers
Send to the mailing list with CC to relevant people:Security issues: Submit privately to [email protected] instead of the public mailing list.
Use of AI
Recommended AI usage:- Use AI to guide you step-by-step in producing a solution yourself
- Use for debugging assistance
- Use to check for mistakes or style issues before submission
- Do NOT copy-paste full AI solutions
GitHub CI
Test your changes on Linux, Mac, and Windows:Fork
Fork https://github.com/git/git to your GitHub account
Subsystems with Dedicated Maintainers
Some parts have separate repositories:- git-gui/ - Johannes Sixt: https://github.com/j6t/git-gui
- gitk-git/ - Johannes Sixt: https://github.com/j6t/gitk
- po/ - Jiang Xin: https://github.com/git-l10n/git-po/
