You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: work/flow.rst
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -474,11 +474,22 @@ We **always use non-fast forward merges** so that the merge point is marked in G
474
474
475
475
.. code-block:: bash
476
476
477
+
# Prepare to merge
478
+
git checkout master
479
+
git pull # Sanity check; if master is up-to-date, skip ahead to "Merge" below
480
+
git checkout tickets/DM-NNNN
481
+
git rebase master
482
+
git push --force # so that the commits on the remote branch match the commits merged*
483
+
# Merge
477
484
git checkout master
478
-
git pull # Sanity check; rebase ticket if master was updated.
479
485
git merge --no-ff tickets/DM-NNNN
480
486
git push
481
487
488
+
We force push the rebased branch for three reasons:
489
+
(1) In many repos, branch protection requires that Travis was run on any commits before they can be pushed onto master
490
+
(2) The policy is to delete branches that have been merged. This is only possible if the exact commit has been merged.
491
+
(3) For convenience, Github will automatically close pull requests if the corresponding branch has been merged to master.
492
+
482
493
**GitHub pull request pages also offer a 'big green button' for merging a branch to master**.
483
494
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.
484
495
Rebasing the ticket branch against ``master`` and doing the non-fast forward merging on the command line is the safest workflow.
0 commit comments