From bfebbeae3fa56bfd6c76fc66020b3ee7fc6287a6 Mon Sep 17 00:00:00 2001 From: Yusra AlSayyad Date: Fri, 28 Sep 2018 20:13:27 -0400 Subject: [PATCH 1/4] Add instructions to rebase and push branch before merging --- work/flow.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/work/flow.rst b/work/flow.rst index 7986f356..79e80ced 100644 --- a/work/flow.rst +++ b/work/flow.rst @@ -479,11 +479,22 @@ We **always use non-fast forward merges** so that the merge point is marked in G .. code-block:: bash + # Prepare to merge + git checkout master + git pull # Sanity check; if master is up-to-date, skip ahead to "Merge" below + git checkout tickets/DM-NNNN + git rebase master + git push --force # so that the commits on the remote branch match the commits merged* + # Merge git checkout master - git pull # Sanity check; rebase ticket if master was updated. git merge --no-ff tickets/DM-NNNN git push +We force push the rebased branch for three reasons: +(1) In many repos, branch protection requires that Travis was run on any commits before they can be pushed onto master +(2) The policy is to delete branches that have been merged. This is only possible if the exact commit has been merged. +(3) For convenience, Github will automatically close pull requests if the corresponding branch has been merged to master. + **GitHub pull request pages also offer a 'big green button' for merging a branch to master**. We discourage you from using this button since there isn't a convenient way of knowing that the merged development history graph will be linear from GitHub's interface. Rebasing the ticket branch against ``master`` and doing the non-fast forward merging on the command line is the safest workflow. From 27308f8d08fbe2fa78c645f732a4e2deb5cd879a Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Fri, 27 Sep 2019 13:31:20 -0700 Subject: [PATCH 2/4] Fix list syntax --- work/flow.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/work/flow.rst b/work/flow.rst index 79e80ced..bf7f2dae 100644 --- a/work/flow.rst +++ b/work/flow.rst @@ -491,9 +491,10 @@ We **always use non-fast forward merges** so that the merge point is marked in G git push We force push the rebased branch for three reasons: -(1) In many repos, branch protection requires that Travis was run on any commits before they can be pushed onto master -(2) The policy is to delete branches that have been merged. This is only possible if the exact commit has been merged. -(3) For convenience, Github will automatically close pull requests if the corresponding branch has been merged to master. + +1. In many repos, branch protection requires that Travis was run on any commits before they can be pushed onto master +2. The policy is to delete branches that have been merged. This is only possible if the exact commit has been merged. +3. For convenience, GitHub will automatically close pull requests if the corresponding branch has been merged to master. **GitHub pull request pages also offer a 'big green button' for merging a branch to master**. We discourage you from using this button since there isn't a convenient way of knowing that the merged development history graph will be linear from GitHub's interface. From 0381e3756424cffb014c79ac454e76402913c842 Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Fri, 27 Sep 2019 13:34:03 -0700 Subject: [PATCH 3/4] Minor copy editing of first bullet item. --- work/flow.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/work/flow.rst b/work/flow.rst index bf7f2dae..f6c4c4a7 100644 --- a/work/flow.rst +++ b/work/flow.rst @@ -492,7 +492,8 @@ We **always use non-fast forward merges** so that the merge point is marked in G We force push the rebased branch for three reasons: -1. In many repos, branch protection requires that Travis was run on any commits before they can be pushed onto master +1. In many repos, GitHub branch protection requires that Travis was run on any commits before they can be pushed onto master. + Branch protections also require that the branch is up-to-date with `master` before a merge is allowed. 2. The policy is to delete branches that have been merged. This is only possible if the exact commit has been merged. 3. For convenience, GitHub will automatically close pull requests if the corresponding branch has been merged to master. From 6aa959a71e2a8318b4600376e2494767542b4589 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 2 Oct 2019 10:27:07 -0700 Subject: [PATCH 4/4] Fix quoting of "master" --- work/flow.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/work/flow.rst b/work/flow.rst index f6c4c4a7..23e287bc 100644 --- a/work/flow.rst +++ b/work/flow.rst @@ -493,7 +493,7 @@ We **always use non-fast forward merges** so that the merge point is marked in G We force push the rebased branch for three reasons: 1. In many repos, GitHub branch protection requires that Travis was run on any commits before they can be pushed onto master. - Branch protections also require that the branch is up-to-date with `master` before a merge is allowed. + Branch protections also require that the branch is up-to-date with ``master`` before a merge is allowed. 2. The policy is to delete branches that have been merged. This is only possible if the exact commit has been merged. 3. For convenience, GitHub will automatically close pull requests if the corresponding branch has been merged to master.