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: source/topics/01-setting_up/github_classroom.rst
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,9 @@ Initial Setup
33
33
=============
34
34
35
35
You will need an account on gitHub to participate in this course.
36
-
If you don't already have a gitHub account, or if you would prefer to create a new one for this course, make sure you setup a new account on `gitHub <https://github.com/>`_. Always keep in mind that your account name will be part of the private repositories that will be created for each of your assignments and it will be visible to both your instructors and your classmates. Make sure you let your instructors know what your gitHub handle is -- it's not always obvious!
36
+
If you don't already have a gitHub account, or if you would prefer to create a new one for this course, make sure you setup a new account on `gitHub <https://github.com/>`_.
37
+
Always keep in mind that your account name will be part of the private repositories that will be created for each of your assignments and it will be visible to both your instructors and your classmates.
38
+
Make sure you let your instructors know what your gitHub handle is -- it's not always obvious!
37
39
38
40
You will need to have git setup on the computer you will use for developing your code for this course.
39
41
You can find instructions for setting up git (and the rest of your development environment) here:
@@ -142,19 +144,19 @@ b) Make a new branch:
142
144
143
145
After that command, git will be "in" the develop branch -- anything you change will only be reflected in that branch.
144
146
145
-
.. note:: A git "branch" is an independent "version" of your code where you can write and change code, create and delete files, etc, and it will be kept separate from the main code. When you are happy with this version, it can be merged into the main branch. For the purposed of this course, it will not be merged into the main branch until it has been reviewed, and both you and your instructors think its done.
147
+
.. note:: A git "branch" is an independent "version" of your code where you can write and change code, create and delete files, etc, and it will be kept separate from the main code. When you are happy with this version, it can be merged into the main branch. For the purposed of this course, it will not be merged into the main branch until it has been reviewed, and both you and your instructors think it's done.
146
148
147
149
If you get an error from this command that says::
148
150
149
151
fatal: A branch named 'develop' already exists
150
152
151
-
That means two things:
153
+
That means one of two things:
152
154
153
-
1) You have already created a develop branch. IN which case you chould already be using it, or you can "check it out" again: `git checkout develop`
155
+
1) You have already created a develop branch. In which case you should already be using it, or you can "check it out" again: `git checkout develop`
154
156
155
157
or
156
158
157
-
2) That branch was created already by gitHub classroom. Which you'd think would be nice, but it turns out that the way it's created doesn't allow the next steps: the Pull Request. THe solution in this case is to use a different name for your working branch, e.g.
159
+
2) That branch was created already by gitHub classroom. Which you'd think would be nice, but it turns out that the way it's created doesn't allow the next steps: the Pull Request. The solution in this case is to use a different name for your working branch, e.g.
158
160
159
161
::
160
162
@@ -204,7 +206,7 @@ b) Commit your work. When you have gotten to a good "pause point" in your work:
204
206
(use "git restore <file>..." to discard changes in working directory)
205
207
modified: install_test.py
206
208
207
-
note that in this case, I edited the ``install_test.py`` file after adding it. When you edit a file, git will not track those changes unless you tell it to, which you can do by running ``git add`` again. So ``git add`` tells git that you want it to keep track of that file -- called "staging for commit"::
209
+
Note that in this case, I edited the ``install_test.py`` file after adding it. When you edit a file, git will not track those changes unless you tell it to, which you can do by running ``git add`` again. So ``git add`` tells git that you want it to keep track of that file -- called "staging for commit"::
208
210
209
211
$ git add install_test.py
210
212
@@ -234,12 +236,12 @@ There is a trick to save a step -- you can ask git to commit all changes you've
234
236
create mode 100644 another_file.py
235
237
create mode 100644 install_test.py
236
238
237
-
The ``-a`` means "all". Note that you still need to use ``git add`` to ask git to track a new file that it is not already managing.
239
+
The ``-a`` means "all". Note that you still need to use ``git add`` to ask git to track a new file that it is not already managing. And be sure to run ``git status`` first to make sure you haven't accidentally added things you didn't want to.
238
240
239
241
5) Push your work to gitHub
240
242
---------------------------
241
243
242
-
All this adding and committing has only affected the repository on your own machine -- gitHub has not been changed.
244
+
All this adding and committing has only affected the repository on your own machine -- the one on gitHub has not been changed.
243
245
In order to get your changes up to gitHub you need to "push" them. It's always a good idea to check the status before you push -- to make sure you're ready.
244
246
245
247
::
@@ -258,7 +260,8 @@ Note that I am on the "develop" branch, which is what's wanted, and nothing new
258
260
259
261
git push --set-upstream origin develop
260
262
261
-
Hmm -- "fatal" -- I don't like the look of that! But it's pretty simple, really. git is telling you that it doesn't know where to push the code to -- your gitHub version of the repo doesn't have a develop branch. But it tells you want to do to create that branch on gitHub (origin), so do that:
263
+
Hmm -- **fatal** -- I don't like the look of that!
264
+
But it's pretty simple, really. git is telling you that it doesn't know where to push the code to -- your gitHub version of the repo doesn't have a develop branch. But it tells you want to do to create that branch on gitHub (origin), so do that:
262
265
263
266
::
264
267
@@ -327,7 +330,7 @@ Put a link to the PR in the LMS, to let us know that you have "turned in" the as
327
330
8) Wait for review
328
331
------------------
329
332
330
-
Once you make your PR, your instructors will be notified by gitHub (and the LMS), and will review your code. They can make general comments, or comment line by line. When a review is done, you should get an email form gitHub. But you can always go and check the PR yourself and see if anything new is there.
333
+
Once you make your PR, your instructors will be notified by gitHub (and the LMS), and will review your code. They can make general comments, or comment line by line. When a review is done, you should get an email from gitHub. But you can always go and check the PR yourself and see if anything new is there.
331
334
332
335
At this point, two things might happen.
333
336
@@ -413,7 +416,7 @@ After adding the file(s), you can commit your code by typing the following::
413
416
414
417
Note that the commit message should be replaced with something descriptive of what that commit includes ("added new functionality", "fixed floating point error", "ready for review", etc.) that will later help you remember what that particular commit was about.
415
418
416
-
.. note:: If you omit the message, git will bring up a text editor to let you write one. If you have not configured git to use another editor, it will be "vi", an venerable old Unix editor that is a real challenge for some. To get out of vi, hit the >escape> key, the a colon and an x: ``:x``. You can configure git to use an editor you are familiar with. See: :ref:`install_nano_win` for how to do that on Windows.
419
+
.. note:: If you omit the message, git will bring up a text editor to let you write one. If you have not configured git to use another editor, it will be "vi", a venerable old Unix editor that is a real challenge for some. To get out of vi, hit the <escape> key, the a colon and an x: ``:x``. You can configure git to use an editor you are familiar with. See: :ref:`install_nano_win` for how to do that on Windows.
417
420
418
421
After every change to the file, you will need to "commit" the changes. Keep in mind that git will not commit all the changes you have made, only the ones that are "staged for commit". You can stage them with the ``git add`` command again. So ``add`` means either "add this file" or "stage this file for committing", depending on whether it's already been added or not.
419
422
@@ -460,7 +463,7 @@ When you submit a comment with a tag, the instructor will be notified by gitHub
460
463
Submitting your assignment
461
464
--------------------------
462
465
463
-
Once your assignment is ready for review, copy the link of your Feedback pull request and submit it in the submission form. Here is an example of a submission link (yours will look a little different but will end with `/pull/1`)::
466
+
Once your assignment is ready for review, copy the link of your Feedback Pull Request and submit it in the submission form. Here is an example of a submission link (yours will look a little different but will end with `/pull/1`)::
0 commit comments