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: .github/CONTRIBUTING.md
+79-50
Original file line number
Diff line number
Diff line change
@@ -223,60 +223,44 @@ We welcome any useful contribution! For your convenience here's a recommended wo
223
223
224
224
### Question & Answer
225
225
226
-
1.**How can I help/contribute?**
226
+
#### How can I help/contribute?
227
227
228
-
All help is extremely welcome - reporting bugs, fixing documentation, adding test cases, solving issues and preparing bug fixes. To solve some issues you can start with label [good first issue](https://github.com/PyTorchLightning/pytorch-lightning/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or chose something close to your domain with label [help wanted](https://github.com/PyTorchLightning/pytorch-lightning/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). Before you start to implement anything check that the issue description that it is clear and self-assign the task to you (if it is not possible, just comment that you take it and we assign it to you...).
228
+
All types of contributions are welcome - reporting bugs, fixing documentation, adding test cases, solving issues, and preparing bug fixes.
229
+
To get started with code contributions, look for issues marked with the label [good first issue](https://github.com/PyTorchLightning/pytorch-lightning/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or chose something close to your domain with the label [help wanted](https://github.com/PyTorchLightning/pytorch-lightning/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). Before coding, make sure that the issue description is clear and comment on the issue so that we can assign it to you (or simply self-assign if you can).
229
230
230
-
2.**Is there a recommendation for branch names?**
231
+
#### Is there a recommendation for branch names?
231
232
232
-
We do not rely on the name convention so far you are working with your own fork. Anyway it would be nice to follow this convention `<type>/<issue-id>_<short-name>` where the types are: `bugfix`, `feature`, `docs`, `tests`, ...
233
+
We recommend you follow this convention `<type>/<issue-id>_<short-name>` where the types are: `bugfix`, `feature`, `docs`, or `tests` (but if you are using your own fork that's optional).
233
234
234
-
3.**How to rebase my PR?**
235
+
#### How to rebase my PR?
235
236
236
-
We recommend creating a PR in separate branch other than `master`, especially if you plan submitting several changes and do not want to wait until the first one is resolved (we can work on them in parallel).
237
+
We recommend creating a PR in a separate branch other than `master`, especially if you plan to submit several changes and do not want to wait until the first one is resolved (we can work on them in parallel).
237
238
238
-
First, make sure you have set [upstream](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork) by running:
239
+
First, make sure you have set [upstream](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork) by running:
Currently we have separate streams/branches for bugfixes/features and release from the default branch (`master`).
317
+
Bugfixes should land in this `master` branch and features should land in `release/X.y-dev`.
318
+
This means that when starting your contribution and creating a branch according to question 2) you should start this new branch from master or future release dev branch.
319
+
Later in PR creation also pay attention to properly set the target branch, usually the starting (base) and target branch are the same.
320
+
321
+
_Note, that this flow may change after the 1.2 release as we will adjust releasing strategy._
322
+
323
+
#### How to fix PR with mixed base and target branches?
324
+
325
+
Sometimes you start your PR as a bug-fix but it turns out to be more of a feature (or the other way around).
326
+
Do not panic, the solution is very straightforward and quite simple.
327
+
All you need to do are these two steps in arbitrary order:
328
+
- Ask someone from Core to change the base/target branch to the correct one
329
+
- Rebase or cherry-pick your commits onto the correct base branch...
330
+
331
+
Let's show how to deal with the git...
332
+
the sample case is moving a PR from `master` to `release/1.2-dev` assuming my branch name is `my-branch`
333
+
and the last true master commit is `ccc111` and your first commit is `mmm222`.
334
+
***Cherry-picking** way
335
+
```bash
336
+
git checkout my-branch
337
+
# create a local backup of your branch
338
+
git checkout -b my-branch-backup
339
+
# reset your branch to the correct base
340
+
git reset release/1.2-dev --hard
341
+
# ACTION: this step is much easier to do with IDE
342
+
# so open one and cherry-pick your last commits from `my-branch-backup`
343
+
# resolve all eventual conflict as the new base may contain different code
344
+
# when all done, push back to the open PR
345
+
git push -f
346
+
```
347
+
***Rebasing way**, see more about [rebase onto usage](https://womanonrails.com/git-rebase-onto)
348
+
```bash
349
+
git checkout my-branch
350
+
# rebase your commits on the correct branch
351
+
git rebase --onto release/1.2-dev ccc111
352
+
# if there is no collision you shall see just success
353
+
# eventually you would need to resolve collision and in such case follow the instruction in terminal
0 commit comments