Skip to content

Commit 71fc239

Browse files
docs: add FAQ for unrelated PR changes
PR-URL: #6415 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Signed-off-by: Athan Reines <[email protected]>
1 parent a644ffe commit 71fc239

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/contributing/FAQ.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ limitations under the License.
3737
- [When should I use decimals in examples, benchmarks, and documentation, and when should I avoid them?](#decimal-usage)
3838
- [How should I name my pull request?](#pr-naming)
3939
- [How do I call the stdlib bot on my PR?](#stdlib-bot)
40+
- [Why were many unrelated files automatically pushed to my PR when I committed my changes?](#auto-push)
4041
- [Frequently used `make` commands](#freq-make-commands)
4142
- [Other Links](#other-links)
4243

@@ -290,6 +291,32 @@ Once you have created your PR, you can call the **stdlib-bot** to perform basic
290291

291292
To see other available bot commands, comment `/stdlib help` on your PR.
292293

294+
<a name="auto-push"></a>
295+
296+
## Why were many unrelated files automatically pushed to my PR when I committed my changes?
297+
298+
When you open a pull request or push changes to your feature branch, GitHub compares your feature branch against your `develop` branch and shows all the differences. If your feature branch contains outdated or extra changes, they will appear in the PR, even if they are unrelated to your work.
299+
300+
To fix this, ensure that your feature branch is based on the latest `develop` branch. You can do this by updating your local `develop` branch and then merging it into your feature branch:
301+
302+
```bash
303+
$ git checkout develop
304+
$ git pull upstream develop
305+
$ git push origin develop
306+
$ git checkout feature-branch
307+
$ git merge develop
308+
```
309+
310+
After merging, push your changes to the remote repository:
311+
312+
```bash
313+
$ git push origin feature-branch # git push also works
314+
```
315+
316+
> **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. If you want to learn more about rebasing/merging, you can refer to our [Git guide][git-guide].
317+
318+
Alternatively, you can call the **stdlib-bot** to merge changes from the `develop` branch into your PR. To do this, comment `/stdlib merge` on your PR.
319+
293320
<a name="freq-make-commands"></a>
294321

295322
## Frequently used `make` commands
@@ -355,6 +382,7 @@ For more `make` commands, refer to the [documentation][benchmark] on running ben
355382
## Other Links:
356383

357384
- [Style Guide][style-guide]
385+
- [Git Cheatsheet][git-guide]
358386
- [Other make commands][make-commands]
359387

360388
<section class="links">
@@ -367,6 +395,8 @@ For more `make` commands, refer to the [documentation][benchmark] on running ben
367395

368396
[github-fork]: https://help.github.com/articles/fork-a-repo/
369397

398+
[git-guide]: https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/git_cheatsheet.md#integration
399+
370400
[development-guide]: https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md
371401

372402
[contributing-guide]: https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md

0 commit comments

Comments
 (0)