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: docs/contributing/git_cheatsheet.md
+22-16Lines changed: 22 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,9 +139,9 @@ Once pushed, your changes will be available on GitHub, and you can proceed to cr
139
139
140
140
A pull request (PR) is a way to suggest changes to a project. It lets maintainers review your work, give feedback, and approve the changes before adding them to the main repository. This is how you officially submit your contributions to `stdlib` after pushing your changes:
141
141
142
-
1. Go to your fork on GitHub.
143
-
2. Click "Compare & pull request."
144
-
3. Add a clear title and description (mention what you changed and why).
142
+
1.Go to your fork on GitHub.
143
+
2.Click "Compare & pull request."
144
+
3.Add a clear title and description (mention what you changed and why).
145
145
146
146
Once you create your pull request, a review request will be **automatically** sent to the maintainers via `stdlib-bot`. Your code will then be reviewed, and you may need to make some tweaks before it gets merged.
147
147
@@ -188,7 +188,7 @@ While working on a feature branch, new changes might be added to the `develop` b
188
188
189
189
Rebasing **moves** your commits on top of the latest `develop`, as if you had started working after the newest updates.
190
190
191
-
#### Steps to Rebase:
191
+
#### Steps to Rebase
192
192
193
193
<!-- run-disable -->
194
194
@@ -209,13 +209,16 @@ git rebase --continue
209
209
#### Example: How Rebase Works
210
210
211
211
Before rebasing (`develop` has new commits `C` and `D`):
212
-
```
212
+
213
+
```plaintext
213
214
X---Y---Z (feature/my-branch)
214
215
/
215
216
A---B---C---D (develop)
216
217
```
218
+
217
219
After rebasing (`X, Y, Z` are reapplied on top of `D`):
218
-
```
220
+
221
+
```plaintext
219
222
X'--Y'--Z' (feature/my-branch, rebased)
220
223
/
221
224
A---B---C---D (develop)
@@ -225,7 +228,7 @@ A---B---C---D (develop)
225
228
226
229
Merging **combines** your feature branch with `develop`, keeping both histories intact and adding a new merge commit.
Before merging (`develop` has new commits `C` and `D`):
250
-
```
253
+
254
+
```plaintext
251
255
X---Y---Z (feature/my-branch)
252
256
/
253
257
A---B---C---D (develop)
254
258
```
259
+
255
260
After merging (`W` is a new merge commit):
256
-
```
261
+
262
+
```plaintext
257
263
X---Y---Z---W (feature/my-branch, merged)
258
264
/ /
259
265
A---B---C-------D (develop)
260
266
```
261
267
262
-
### Which one should you use?
268
+
### Choosing the Right One
263
269
264
270
Use **Rebase** if:
265
-
- You want a clean, linear history.
266
-
- You are working alone or sure that no one else depends on your commits.
271
+
272
+
- You want a clean, linear history.
273
+
- You are working alone or sure that no one else depends on your commits.
267
274
268
275
Use **Merge** if:
269
-
- You want a safer approach that doesn’t rewrite history.
270
-
- You are unsure about rebase or are collaborating on the branch.
276
+
277
+
- You want a safer approach that doesn’t rewrite history.
278
+
- You are unsure about rebase or are collaborating on the branch.
271
279
272
280
> **When in doubt, use merge.** It is safer and avoids potential conflicts caused by rewriting history. If you use the GitHub UI to update your branches, it also performs a merge.
273
281
@@ -289,8 +297,6 @@ To get started with your first contribution, check out the [Contributing Guide][
0 commit comments