From 66494b3e310c400761627b2d3febd0269121deec Mon Sep 17 00:00:00 2001 From: eccles Date: Tue, 1 Jun 2021 12:18:35 +0100 Subject: [PATCH] Use git merge in defined user workflow Problem: Use of git pull --rebase was not correct Solution: Use 'git merge upstream/main' to synchronize upstream Signed-off-by: eccles --- README.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5d59aad..0412f55 100644 --- a/README.md +++ b/README.md @@ -96,20 +96,10 @@ Bring in latest changes from upstream: ```bash git fetch upstream git checkout main -git pull --rebase upstream main +git merge upstream/main git checkout dev/githubUserHandle/some-proposed-fix git rebase -i --autosquash main ``` -> Caveat -> -> Note that we are rebasing to pull in upstream changes. This assumes that -> the branch is only accessed/written by one person. If the branch is -> collaborative the better option is to 'git merge main' as this is -> safer but pollutes the git history with merge commits. -> See https://www.atlassian.com/git/tutorials/merging-vs-rebasing#the-golden-rule-of-rebasing -> -> This caveat applies to all occurrences of 'git rebase' in this document. - Ensure that your email and name are correct: @@ -159,7 +149,7 @@ squash all your fixups after syncing upstream: ```bash git fetch upstream git checkout main -git pull --rebase upstream main +git merge upstream/main git checkout dev/githubUserHandle/some-proposed-fix git rebase -i --autosquash main git push -f @@ -174,7 +164,7 @@ At this point one must tidy up the local fork: ```bash git fetch upstream git checkout main -git pull +git merge upstream/main git log git branch -d dev/githubUserHandle/some-proposed-fix ```