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
Describe two methods for obtaining the code: cloning PR branch, or adding a remote.
Specify which directories one should be in when executing the code.
Copy file name to clipboardExpand all lines: doc/contributing.rst
+22-6Lines changed: 22 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -302,17 +302,33 @@ The only people with write access to the main repository are a small number of c
302
302
303
303
**Everyone can review and comment on pull requests.** Even if you are not one of the core developers you can still comment on a pull request.
304
304
305
-
To test pull requests locally you should:
305
+
To test pull requests locally you should download the pull request branch. You can do this either by cloning the branch from the pull request:
306
306
307
-
- add the repository of the user proposing the pull request as a remote, :code:`git remote add user_name https://github.com/user_name/MITgcm.git` where user_name is replaced by the user name of the person who has made the pull request;
where `USERNAME` is replaced by the username of the person proposing the pull request, and `BRANCHNAME` is the branch from the pull request.
308
312
309
-
- download a local version of the branch from the pull request, :code:`git fetch user_name` followed by :code:`git checkout --track user_name/foo`;
313
+
Alternatively, you can add the repository of the user proposing the pull request as a remote to your existing local repository. Move directories in to your local repository and then
- possibly push fixes or changes directly to the pull request.
319
+
where USERNAME is replaced by the user name of the person who has made the pull request. Then download the branch from the pull request
314
320
315
-
None of these steps, apart from the final one, require write access to the main repository. This means that anyone can review pull requests. However, unless you are one of the core developers you won't be able to directly push changes. You will instead have to make a comment describing any problems you find.
321
+
::
322
+
323
+
git fetch USERNAME
324
+
325
+
and switch to the desired branch
326
+
327
+
::
328
+
329
+
git checkout --track USERNAME/foo
316
330
317
331
332
+
You now have a local copy of the code from the pull request and can run tests locally. If you have write access to the main repository you can push fixes or changes directly to the pull request.
318
333
334
+
None of these steps, apart from pushing fixes back to the pull request, require write access to either the main repository or the repository of the person proposing the pull request. This means that anyone can review pull requests. However, unless you are one of the core developers you won't be able to directly push changes. You will instead have to make a comment describing any problems you find.
0 commit comments