Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
Branches
The OpenCV repository has several branches with different contribution policies.
- Your development branch name must differ from the names of branches in the upstream OpenCV repository, i.e. your branch mustNOT be named2.4,3.4,4.x,5.x, ormaster/next(it's a technical requirement specific to our continuous integration system to properly test multi-repository patches with opencv_extra/opencv_contrib)
- Multiple related commits should besquashed into one.A pull request must contain either a single commit, or several unrelated commits (e.g, commit with test + commit with code fix)
Please target Pull Requests (PR) to the right branches. Quick summary of the rules is presented in the table below. More formal description is in the sections after the table.
| Policy | 5.x | 4.x |
|---|---|---|
| Preserve API compatibility | ✔️ | ✔️ |
| Preserve ABI compatibility | ❌ | ❌❕ |
| Change applicable only to this branch | ✔️ | ✔️ |
| Bugfix / minor fix | 👉 | ✔️ |
| Optimization | 👉 | ✔️ |
| Small feature | 👉 | ✔️ |
| Large feature | ✔️ | ❌ |
| Branch alias (do not use!) | next | master |
- ❕ - avoid major breakages
- 👉 - rebase to previous branch if patch is applicable, it will be ported to other branches by the Core team in a week or two
This is the development branch for upcoming5.x releases.
- API compatibility must be preserved
- If your pull request contains a bug fix which is also applicable to the3.4 or4.x branch, you should choose that branch as "base"
- If you've already created pull request based on the5.x branch, but it is also applicable to4.x, you will be asked to rebase it to 4.x/3.4 branches, see the instruction in the following section.
This is the branch for4.x releases.
- API compatibility must be preserved
- Incompatible improvements or large features should be targeted to5.x branch
- Compatible improvements or small features should go to4.x branch
- If your pull request contains a bug fix which is also applicable to the3.4 branch, you should choose that branch as "base"
- If you've already created pull request based on the4.x branch, but it is also applicable to3.4, you will be asked to rebase it to 3.4, see the instruction in the following section.
- We will merge changes from4.x into5.x regularly (weekly/bi-weekly)There is no regular process for backporting patches from5.x branch
EOL branches:
"3.4": this is the branch for3.4.x releases. This release series is EOL in 2023. CI is turned off, so no more patches are accepted to 3.4 branch.
"2.4": this is the branch for2.4.x releases. This release series is EOL in 2020. CI is turned off, so no more patches are accepted to 2.4 branch.
"master" branch is a shadow copy of 4.x development branch kept for compatibility purposes. After 5.0 release this branch will shadow5.x branch."next" branch is a shadow copy of 5.x development branch kept for compatibility purposes. It will be removed after 5.0 release.Merge to this branches is prohibited. Use 4.x / 5.x as target branches for your PRs.
If you can not do this by yourself, please ask maintainers for help.
Example of rebasing from 5.x branch to 4.x branch:
- do not close the existing pull request
- change the "base" branch of the pull request:
- open PR on GitHub in your browser
- press the "Edit" button near the pull request title
- choose "4.x" from the dropdown list
- rebase your commits from 5.x onto 4.x:
git checkout <your-branch>- (optional) create a backup branch:
git branch <your-branch>-backup git remote update upstream(assumingupstreamis pointing to theopencv/opencvGitHub repository)git rebase -i --onto upstream/4.x upstream/5.x- an editor will be opened. Please check the list of commits - there should be only your commits - save and exit
git push --force origin <your-branch>(assumingoriginis pointing to<your-username>/opencvforked GitHub repository)
- GitHub Flow guide
- Forking Projects guide
- ABI Compliance Checker tool
© Copyright 2019-2025, OpenCV team