- Don't merge own PRs
- Don't do direct changes (submit a PR instead)
- Clone your fork
- Add modxcms/revolution as a remote (
git remote add upstream git@github.com:modxcms/revolution.git
) - Update .git/config and add
fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*
in section[remote "upstream"]
- Run
git fetch upstream
It's a good practise to have 2.5.x
and 2.x
branch in different folders so you don't have to re-build core & re-run setup each time you switch between those two.
2.5.x branch represents the upcoming patch release (2.5.X), 2.x branch represents the next significant release (2.X.0). Until 2.x branch diverges, 2.5.x branch is merged to 2.x after merging PRs. After 2.x branch diverges, PRs targeted to 2.5.x needs to be cherry picked to 2.x.
- Assign PR to yourself
- Add PR to milestone
- Prepare merge/cherry-pick
- Review code & test functionality
- Add change log entry
- Proceed merge/cherry-pick
Pre-requisite:
- PR is targeted to correct branch
Prepare merge:
git merge --no-ff --no-commit --log upstream/pr/123
(replace 123 with PR ID)
Proceed merge:
git add --all
(adds change log and all other changed files)git commit
(Enter some nice commit message reflecting the change log entry)git push upstream 2.5.x/2.x
(pick just 2.5.x or 2.x)
Pre-requisite:
- PR is targeted to wrong branch
- Develop diverged from master
git cherry-pick -x -n xxxxxxx
(replacexxxxxxx
with commit hash)
git add --all
(adds change log and all other changed files)git commit -c xxxxxxx
(replacexxxxxxx
with commit hash)git push upstream 2.5.x/2.x
(pick just 2.5.x or 2.x)
git checkout -b branch-name
(replacebranch-name
with reasonable branch name reflecting the PR functionality)
Repeat for each commit:
git cherry-pick -x -n xxxxxxx
(replacexxxxxxx
with commit hash)git commit -c xxxxxxx
(replace xxxxxxx with commit hash)git checkout 2.5.x/2.x
(choose 2.5.x or 2.x)git merge --no-ff --no-commit --log branch-name
(replace branch-name with same name as in first step)
Proceed cherry-pick:
- git
add --all
(adds change log and all other changed files) - git
commit
(Enter some nice commit message reflecting the change log entry) - git
push upstream 2.5.x/2.x
(choose 2.5.x or 2.x)