Skip to content

Commit

Permalink
Rebase vs Merge guidance
Browse files Browse the repository at this point in the history
  • Loading branch information
mrwilson committed Aug 24, 2023
1 parent f0bc870 commit 80102df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/standards/source-code/working-with-git.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ In this case you should communicate this to affected staff within GDS, so they k
You should use `git merge` with `--no-ff` if you are manually merging a feature branch into your repository's trunk branch rather than GitHub's own merge capability.
This option preserves evidence of your feature branch in the repository history by creating a merge commit even if your changes could be simply applied to the trunk branch.

You should use the merge strategy that best suits the context of your team and project.
Rebasing changes onto your trunk branch maintains a linear history but commits are not guaranteed to be in time order.
Merging changes creates a merge commit which is useful as a known integration point for a change but the repository history becomes non-linear.

## Do not use `git push -f`, use `--force-with-lease` instead

Force pushing in git is a subject that attracts all kinds of religious
Expand Down

0 comments on commit 80102df

Please sign in to comment.