Skip to content

Commit 3eb71e0

Browse files
committed
docs: add rationale for using merge over rebase
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 036ceeb commit 3eb71e0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/contributing/git_cheatsheet.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,28 +452,29 @@ Assuming you've already cloned the repository and set up your identity:
452452
453453
```bash
454454
$ git checkout develop
455-
$ git pull --ff-only upstream develop # Update local develop first
455+
$ git pull upstream develop # Update local develop first
456+
$ git push origin develop
456457
$ git checkout feature/is-even
457-
$ git rebase develop # or git merge develop
458+
$ git merge develop
458459
```
459460
460-
Resolve any conflicts with the steps mentioned earlier, then continue the rebase:
461+
Resolve any conflicts with the steps mentioned earlier, then continue the merge:
461462
462463
<!-- run-disable -->
463464
464465
```bash
465-
$ git rebase --continue
466+
$ git merge --continue
466467
```
467468
468469
Finally, push your changes:
469470
470471
<!-- run-disable -->
471472
472473
```bash
473-
$ git push --force # Force push after rebasing
474+
$ git push origin feature/is-even
474475
```
475476
476-
> **Note:** Force pushing is required after rebasing because it rewrites history. This is safe as long as you're the only one working on the branch. If you want to avoid force pushing, use merge instead of rebase.
477+
> **Note:** When developing stdlib, we recommend using `merge` instead of `rebase` once a PR is open. Rebasing rewrites your branch history, which usually requires a force-push to update the remote branch. This can disrupt other contributors who are reviewing or collaborating on your PR. Since stdlib uses squash and merge for PRs, we don't require a clean, linear commit history. Merge commits are acceptable as long as your diff only contains relevant changes.
477478
478479
8. **Repeat**: After resolving conflicts and updating your branch, you can continue making changes, committing, and pushing until your PR is ready to be merged.
479480

0 commit comments

Comments
 (0)