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
{{ message }}
Repository navigation
Commit ec8a44f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: _sources/topics/01-setting_up/github_classroom.rst.txt
+20-30Lines changed: 20 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,22 +115,24 @@ d) Clone the repo
115
115
This will create a new directory for the repository, named by the assignment and your gitHub handle -- this is where you will put all the work for that assignment.
116
116
117
117
118
-
3) Create a develop branch for your work
119
-
----------------------------------------
118
+
3) Use the develop branch for your work
119
+
---------------------------------------
120
120
121
-
Create and check out a new branch for your work.
121
+
Check out a different branch for your work.
122
122
123
123
a) Change the working directory to the repo just created by the clone:
124
124
125
125
::
126
126
127
127
cd the_name_of_the_assignment_repo
128
128
129
-
b) Make a new branch:
129
+
b) Checkout the develop branch
130
130
131
131
::
132
132
133
-
git checkout -b develop
133
+
git checkout develop
134
+
135
+
Note: there should be a "develop" branch already in the repo. If not, you will get an error, but you can create the branch by hand by adding the ``-b`` flag: ``git checkout -b develop``
134
136
135
137
After that command, git will be "in" the develop branch -- anything you change will only be reflected in that branch.
136
138
@@ -225,33 +227,21 @@ In order to get your changes up to gitHub you need to "push" them. It's always a
225
227
Note that I am on the "develop" branch, which is what's wanted, and nothing new to commit -- all my changes have been committed -- it's time to push.
226
228
227
229
::
228
-
229
230
$ git push
230
-
fatal: The current branch develop has no upstream branch.
231
-
To push the current branch and set the remote as upstream, use
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
238
+
To https://github.com/UWPCE-Py310-Fall2020/fizz-buzz-PythonCHB.git
239
+
46d868a..fe3e479 develop -> develop
234
240
235
-
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:
241
+
.. note:: If you don't have a develop branch up on gitHUb, you will get a "fatal" Error. Scary, 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: ``git push --set-upstream origin develop`` -- and you should be good to go.
236
242
237
-
::
243
+
Now the local develop branch is hooked up to a develop branch on gitHub.
To https://github.com/UWPCE-Py310-Fall2020/initial-setup-PythonCHB.git
251
-
* [new branch] develop -> develop
252
-
Branch 'develop' set up to track remote branch 'develop' from 'origin'.
253
-
254
-
Good -- now the local develop branch is hooked up to a develop branch on gitHub. And it even tells you what to do next -- see the "Create a pull request for 'develop' on gitHub by visiting:" -- that's exactly what you need to do!
255
245
256
246
6) Complete the Assignment
257
247
--------------------------
@@ -345,7 +335,7 @@ I'm sure this seems like a lot, but it will get to be a habit, Here are the step
345
335
346
336
2) Clone the resulting repo onto your work machine (``git clone``)
347
337
348
-
3) Make a develop branch (``git checkout -b develop``)
338
+
3) Switch to the develop branch (``git checkout develop``)
349
339
350
340
4) Do the assignment in the develop branch, committing and pushing as you go. (``git add``; ``git commit -a -m "a message"``; ``git push``)
351
341
@@ -359,7 +349,7 @@ I'm sure this seems like a lot, but it will get to be a habit, Here are the step
359
349
360
350
Is that so bad?
361
351
362
-
Remember: this seems like a lot -- but it *does* reflect he real workflow when doing real coding. Even if you work alone, a version control system is a really good idea.
352
+
Remember: this seems like a lot -- but it *does* reflect the real workflow when doing real coding. Even if you work alone, a version control system is a really good idea.
<p>(you should be able to type <codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">clone</span></code> and then paste the url you copied from gitHub)</p>
271
271
<p>This will create a new directory for the repository, named by the assignment and your gitHub handle – this is where you will put all the work for that assignment.</p>
<h3>3) Create a develop branch for your work<aclass="headerlink" href="#create-a-develop-branch-for-your-work" title="Permalink to this headline">¶</a></h3>
275
-
<p>Create and check out a new branch for your work.</p>
<h3>3) Use the develop branch for your work<aclass="headerlink" href="#use-the-develop-branch-for-your-work" title="Permalink to this headline">¶</a></h3>
275
+
<p>Check out a different branch for your work.</p>
276
276
<olclass="loweralpha simple">
277
277
<li><p>Change the working directory to the repo just created by the clone:</p></li>
<p>Note: there should be a “develop” branch already in the repo. If not, you will get an error, but you can create the branch by hand by adding the <codeclass="docutils literal notranslate"><spanclass="pre">-b</span></code> flag: <codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">checkout</span><spanclass="pre">-b</span><spanclass="pre">develop</span></code></p>
288
289
<p>After that command, git will be “in” the develop branch – anything you change will only be reflected in that branch.</p>
289
290
<divclass="admonition note">
290
291
<pclass="admonition-title">Note</p>
@@ -370,31 +371,24 @@ <h3>5) Push your work to gitHub<a class="headerlink" href="#push-your-work-to-gi
370
371
</pre></div>
371
372
</div>
372
373
<p>Note that I am on the “develop” branch, which is what’s wanted, and nothing new to commit – all my changes have been committed – it’s time to push.</p>
fatal: The current branch develop has no upstream branch.
375
-
To push the current branch and set the remote as upstream, use
376
-
377
-
git push --set-upstream origin develop
378
-
</pre></div>
379
-
</div>
380
-
<p>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:</p>
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
383
+
To <aclass="reference external" href="https://github.com/UWPCE-Py310-Fall2020/fizz-buzz-PythonCHB.git">https://github.com/UWPCE-Py310-Fall2020/fizz-buzz-PythonCHB.git</a>
384
+
46d868a..fe3e479 develop -> develop</p>
385
+
</dd>
386
+
</dl>
387
+
<divclass="admonition note">
388
+
<pclass="admonition-title">Note</p>
389
+
<p>If you don’t have a develop branch up on gitHUb, you will get a “fatal” Error. Scary, 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: <codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">push</span><spanclass="pre">--set-upstream</span><spanclass="pre">origin</span><spanclass="pre">develop</span></code> – and you should be good to go.</p>
396
390
</div>
397
-
<p>Good – now the local develop branch is hooked up to a develop branch on gitHub. And it even tells you what to do next – see the “Create a pull request for ‘develop’ on gitHub by visiting:” – that’s exactly what you need to do!</p>
391
+
<p>Now the local develop branch is hooked up to a develop branch on gitHub.</p>
398
392
</div>
399
393
<divclass="section" id="complete-the-assignment">
400
394
<h3>6) Complete the Assignment<aclass="headerlink" href="#complete-the-assignment" title="Permalink to this headline">¶</a></h3>
@@ -464,7 +458,7 @@ <h3>16) Want to improve it after it’s been accepted?<a class="headerlink" href
464
458
<div><olclass="arabic simple">
465
459
<li><p>Accept the assignment from the gitHub classroom link</p></li>
466
460
<li><p>Clone the resulting repo onto your work machine (<codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">clone</span></code>)</p></li>
467
-
<li><p>Make a develop branch (<codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">checkout</span><spanclass="pre">-b</span><spanclass="pre">develop</span></code>)</p></li>
461
+
<li><p>Switch to the develop branch (<codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">checkout</span><spanclass="pre">develop</span></code>)</p></li>
468
462
<li><p>Do the assignment in the develop branch, committing and pushing as you go. (<codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">add</span></code>; <codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">commit</span><spanclass="pre">-a</span><spanclass="pre">-m</span><spanclass="pre">"a</span><spanclass="pre">message"</span></code>; <codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">push</span></code>)</p></li>
469
463
<li><p>When complete or when you would like some help, make a PR on gitHub, and post a link to the PR in the LMS (Canvas or EdX)</p></li>
470
464
<li><p>Read and respond to the comments on gitHub from your instructors</p></li>
@@ -473,7 +467,7 @@ <h3>16) Want to improve it after it’s been accepted?<a class="headerlink" href
473
467
</ol>
474
468
</div></blockquote>
475
469
<p>Is that so bad?</p>
476
-
<p>Remember: this seems like a lot – but it <em>does</em> reflect he real workflow when doing real coding. Even if you work alone, a version control system is a really good idea.</p>
470
+
<p>Remember: this seems like a lot – but it <em>does</em> reflect the real workflow when doing real coding. Even if you work alone, a version control system is a really good idea.</p>
<h2>General Advice for working with git and gitHub<aclass="headerlink" href="#general-advice-for-working-with-git-and-github" title="Permalink to this headline">¶</a></h2>
0 commit comments