From 4fd8d2f6390fbb7753f7e7a11d19c320b80a8024 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 8 Aug 2017 21:15:00 +0100 Subject: [PATCH 1/3] Allow updating change branches via rebase or merge Allow for pulling in changes from the source branch either via rabasing or merging, instead of only allowing rebasing. Rebasing is still recommended however. --- common-flow.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/common-flow.md b/common-flow.md index 49f9d1d..c6e5c5a 100644 --- a/common-flow.md +++ b/common-flow.md @@ -72,11 +72,17 @@ interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). needs a designated "merge target" branch, typically this will be the same as the source branch. 7. Change branches MUST be regularly updated with any changes from their - source branch. This MUST be done by rebasing the change branch on top of - the source branch. - 8. After rebasing a change branch on top of its source branch you MUST push - the change branch to the remote server. This will require you to do a - force push, and you SHOULD use the "--force-with-lease" git push option. + source branch. It is RECOMMENDED this update is done by rebasing the + change branch on top of the source branch. Alternatively it can be done + by merging the source branch into the change branch. + 8. You MUST NOT use a mixture of rebase and merge to update change branches + from their source branch. Pick one method for the project and/or team, + and stick to it. + 9. After updating a change branch from its source branch you MUST push the + change branch to the remote server. If you updated the change branch via + rebasing, you will be required to do a force push, and you MUST use the + "--force-with-lease" git push option when doing so instead of the regular + "--force". 4. Pull Requests 1. To merge a change branch into its merge target, you MUST open a "pull request" (or equivalent). From 0b2cde114af4db3bfd6fa08d3ee83d70dc607c09 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 25 Aug 2017 09:42:40 +0100 Subject: [PATCH 2/3] Enforce change branch update via rebase, allow merge if really needed --- common-flow.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/common-flow.md b/common-flow.md index c6e5c5a..6021542 100644 --- a/common-flow.md +++ b/common-flow.md @@ -72,17 +72,20 @@ interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). needs a designated "merge target" branch, typically this will be the same as the source branch. 7. Change branches MUST be regularly updated with any changes from their - source branch. It is RECOMMENDED this update is done by rebasing the - change branch on top of the source branch. Alternatively it can be done - by merging the source branch into the change branch. - 8. You MUST NOT use a mixture of rebase and merge to update change branches - from their source branch. Pick one method for the project and/or team, - and stick to it. - 9. After updating a change branch from its source branch you MUST push the - change branch to the remote server. If you updated the change branch via - rebasing, you will be required to do a force push, and you MUST use the + source branch. This MUST be done by rebasing the change branch on top of + the source branch. + 8. After updating a change branch from its source branch you MUST push the + change branch to the remote server. Due to the nature of rebasing, you + will be required to do a force push, and you MUST use the "--force-with-lease" git push option when doing so instead of the regular "--force". + 9. If there is a truly valid technical reason to not use rebase when + updating change branches, then you can update change branches via merge + instead of rebase. The decision to use merge MUST only be taken after all + possible options to use rebase have been tried and failed. For example, + people not understanding how to use rebase is NOT a valid reason to use + merge. If you do decide to use merge instead of rebase, you MUST NOT use + a mixture of both methods, pick one and stick to it. 4. Pull Requests 1. To merge a change branch into its merge target, you MUST open a "pull request" (or equivalent). From 610d131dd5fadce3548c4d9df4ca07914d5f9ff5 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 25 Aug 2017 13:15:31 +0100 Subject: [PATCH 3/3] Minor rewording --- common-flow.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common-flow.md b/common-flow.md index 6021542..069bba8 100644 --- a/common-flow.md +++ b/common-flow.md @@ -82,10 +82,10 @@ interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). 9. If there is a truly valid technical reason to not use rebase when updating change branches, then you can update change branches via merge instead of rebase. The decision to use merge MUST only be taken after all - possible options to use rebase have been tried and failed. For example, - people not understanding how to use rebase is NOT a valid reason to use - merge. If you do decide to use merge instead of rebase, you MUST NOT use - a mixture of both methods, pick one and stick to it. + possible options to use rebase have been tried and failed. People not + understanding how to use rebase is NOT a valid reason to use merge. If + you do decide to use merge instead of rebase, you MUST NOT use a mixture + of both methods, pick one and stick to it. 4. Pull Requests 1. To merge a change branch into its merge target, you MUST open a "pull request" (or equivalent).