From e87c39405f6ad803fd69994409a3b83e32a0cd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20K=C3=BCthe?= Date: Sun, 1 Jan 2023 19:38:25 +0100 Subject: [PATCH] add tutorial how to squash commits in git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marek Küthe --- docs/entitydb/format-rules.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/entitydb/format-rules.md b/docs/entitydb/format-rules.md index 246ee8c..7916045 100644 --- a/docs/entitydb/format-rules.md +++ b/docs/entitydb/format-rules.md @@ -30,5 +30,24 @@ The edb repository currently contains two different scripts: | `test.sh` | Tests the JSON files for validity | | `build_maxlen_filter.sh` | Builds a bird-compatible filter list | +## Do I need to sqash my commits before setting a PR? +Yes and No. Changes to files should be traceable. Therefore, a commit is recommended for every change. However, we also want to avoid more than 30 commits for one file in one PR. Therefore, if there are still mistakes in the initial registration, it would be nice to keep the number of commits within limits. + +With the following commands you can squash two commits to one: +``` +git rebase -i HEAD~2 +``` +Replace the second `pick` with `s` or `squash`. Save the file and exit. +Enter your new commit message. Save the file and exit. +Sign the commit with the following command: +``` +git commit --amend -s -S +``` + +After that you can upload the changes. If the Git server rejects the changes, you can use the following command: +``` +git push -f +``` + ## License The edb is available under the AGPL v3 license. More information is available in the `LICENSE.md` in the repository of the edb.