Skip to content
Snippets Groups Projects
Unverified Commit 273c8ea4 authored by HonkingGoose's avatar HonkingGoose Committed by GitHub
Browse files

docs: improve Branches and Commits Methodology (#7706)


Co-authored-by: default avatarRhys Arkins <rhys@arkins.net>
parent 06c9d9df
No related branches found
No related tags found
No related merge requests found
...@@ -2,16 +2,20 @@ ...@@ -2,16 +2,20 @@
## Multiple files per branch ## Multiple files per branch
Renovate can/should update multiple files in the same branch/PR. Renovate can, and should, update multiple files in the same branch/PR.
e.g. it might be `package.json` and `yarn.lock`, or it might be multiple `package.json` files in a monorepo.
e.g. Renovate can update the `package.json` and the corresponding `yarn.lock` file in the same commit.
The bot can also update multiple package files at once in a monorepo, including from different package managers.
## One commit per branch ## One commit per branch
To keep things neat from a user perspective, and simplify things from Renovate's perspective, we aim to always use just one commit per branch, even when multiple files need updating. To keep things neat: Renovate always makes one commit per branch, even when multiple files need updating.
This way we can use the following logic:
A positive side effect of this is that it allows us to have a shortcut rule of, "If there's only one commit in the branch then it's clean, otherwise it must have been edited by users and we should stop updating it". - If the last commit in a branch was using Renovate's identity, we assume it to be clean.
- If the last commit in a branch is by an identity other than Renovate's, the branch is assumed to have been edited by users and Renovate will not push to it any longer.
## Updating branches ## Updating branches
If files in an already-existing branch need updating (e.g. an even newer version has been released), then we still aim to have just one commit. If files in an already-existing branch need updating (e.g. an even newer version has been released), then we still want to have only one commit.
We achieve this by force pushing with `git` to the existing branch. Renovate achieves this by force pushing the necessary changes to the existing branch with `git`.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment