Skip to content

Commit

Permalink
Merge branch 'main' of github.com:UBC-DSCI/dsci-310-student
Browse files Browse the repository at this point in the history
  • Loading branch information
ttimbers committed Jan 21, 2024
2 parents cdb2c41 + 674b5bf commit 00c87a8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 122 deletions.
2 changes: 1 addition & 1 deletion docs/assessments.html
Original file line number Diff line number Diff line change
Expand Up @@ -2561,7 +2561,7 @@ <h3 id="assessment-schedule">Assessment schedule</h3>
<td>2</td>
</tr>
<tr class="odd">
<td>Individual assignment 2</td>
<td><a href="individual_assignment2.html">Individual assignment 2</a></td>
<td>Version control practice</td>
<td>2023/01/27 23:59</td>
<td>3</td>
Expand Down
155 changes: 34 additions & 121 deletions docs/individual_assignment2.html
Original file line number Diff line number Diff line change
Expand Up @@ -2503,129 +2503,50 @@ <h1>Individual assignment 2</h1>
<nav class="l-text toc figcaption" id="TOC">
<h3>Contents</h3>
<ul>
<li><a href="#canvas-quiz" id="toc-canvas-quiz">Canvas “Quiz”</a></li>
<li><a href="#activity" id="toc-activity">Activity</a></li>
<li><a href="#submission-instructions" id="toc-submission-instructions">Submission Instructions</a></li>
<li><a href="#rubric" id="toc-rubric">Rubric</a></li>
</ul>
</nav>
</div>
<p>The purpose of this assignment is to start familiarizing yourselves with version control with Git and GitHub.
It will build on the git demos in class as well as the TA tutorials from week 1 (intro shell/bash) and week 2 (merge conflicts).</p>
<p>There are <strong>two</strong> parts to this assignment:</p>
<ol type="1">
<li>A short quiz that you can find on Canvas (open book, unlimited time)</li>
<li>A more hands-on activity where you will resolve a merge conflict in Git.</li>
</ol>
<h3 id="canvas-quiz">Canvas “Quiz”</h3>
<ul>
<li>Go to Canvas and complete the “Individual assignment 2” Quiz.</li>
</ul>
<h3 id="activity">Activity</h3>
<p>For this portion of the assignment,
we will create a toy repository with a merge conflict and learn how to resolve it.
It will build on the git demos in class as well as the TA tutorials from week 1 (intro shell/bash) and week 2 (merge conflicts).
Specifically, we will create a toy repository with a merge conflict and learn how to resolve it.
A merge conflict occurs when Git is unable to automatically determine how to incorporate new changes.
This can can occur when two branches modify the same line,
or when a file is deleted when someone else is changing it.
You can read more about merge conflicts here: <a href="https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts">Git merge conflicts</a>.</p>
<h4 id="step-1-create-assignment-repository">Step 1: Create Assignment Repository</h4>
<p>First, we need to create a remote repository where the conflict will occur.</p>
<ol type="1">
<li>Navigate to <a href="https://github.com/">github.com</a> and click the <code>+</code> button at the top right of the screen, and then “New Repository”.</li>
<li>Name the repository <strong><code>dsci-310-assign2</code></strong> (this repository name is important).</li>
<li>Check off “Add a README file”</li>
<li><strong>Keep all other settings as default, and ensure the repository is public.</strong> Click on “Create repository”.</li>
</ol>
<h4 id="step-2-clone-repository">Step 2: Clone Repository</h4>
<p>Follow the instructions listed below. You will be graded for completion.</p>
<ol type="1">
<li>Open a new terminal and navigate to a directory (using <code>cd</code>) where you want the repository to live (i.e., where you will <code>git clone</code>)</li>
<li>Copy the HTTPS (or SSH) URL of your github repository (under the green code button in GitHub).
<li><p>Create a new public repository on GitHub.com named <code>learning-about-version-control</code>. Make sure the repository:</p>
<ul>
<li>Towards the top of the screen in your new empty remote repository.</li>
<li>It should look something like this: <code>https://github.com/jbourak/dsci-310-assign2.git</code></li>
<li>Includes a <code>README</code> that has a header that says “Learning about Version Control” and has your name listed as the author.</li>
<li>Is public</li>
</ul></li>
<li><code>git clone</code> the repository down to your computer to the folder you <code>cd</code> into earler
<li><p>Clone your <code>learning-about-version-control</code> repository to your local computer.</p></li>
<li><p>Create and resolve a merge conflict 😱!</p>
<ul>
<li>You should <strong>not</strong> be <code>git clone</code>ing into an existing repository</li>
<li>Before you run <code>git clone</code> if you type <code>git status</code> it should return:</li>
</ul>
<pre><code>git status
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).</code></pre>
<h4 id="step-3-prepare-assignment">Step 3: Prepare Assignment</h4></li>
</ol>
<p>Now we will run a script that will create a new toy repository with a history where a merge conflict can occur and push it to our remote repository.</p>
<ol type="1">
<li>Check that you are now into your <code>dsci-310-assign2</code> folder
<ul>
<li>If you haven’t done so your <code>pwd</code> should show that you are in <code>dsci-310-assign2</code></li>
<li>If not, <code>cd dsci-310-assign2</code> into your folder</li>
<li>On your remote version control repository, use the pen tool to add a line to the README that says “Solving merge conflicts is easy!”</li>
<li>On your local version control repository, edit the same line in the README that you just edited, but this time write “Solving merge conflicts is soooooo hard!”</li>
<li>Add and commit your local changes to the <code>README</code>, and the try to push the file so that you create the merge conflict.</li>
<li>Resolve the merge conflict on your local computer so that the line reads “Solving merge conflicts takes conscious effort, but I can do it!”. Take a screen shot while you are resolving the conflict to document you did this.</li>
<li>Push the local changes to your remote version control repository.</li>
</ul></li>
<li>Download the <code>create_conflict.sh</code> script into your <code>dsci-310-assign2</code> repository
<ul>
<li>You can find the URL to the script <a href="https://raw.githubusercontent.com/UBC-DSCI/dsci-310-student/main/src/create_conflict.sh">here</a></li>
<li>You can download the file by using one of the two methods below:
<li><p>Create and accept a pull request!</p>
<ul>
<li>Right clicking &gt; save page as into your <code>dsci-310-assign2</code> folder OR</li>
<li>In Terminal/Git Bash, run (this is a multi line command copy and paste all of it at once):</li>
</ul></li>
<li>Create a new Git branch on your local version control repository named <code>opinions</code> and switch to that branch.</li>
<li>Edit your <code>README</code> so that you add at least one sentence about what you like most about version control, and add at least one sentence about what you find most challenging/confusing/frustrating about version control (we all have opinions on this one…). Add and commit your changes to local version control.</li>
<li>Push the changes to the <code>README</code> that you made on the <code>opinions</code> branch to the remote repository on GitHub.com.</li>
<li>Visit GitHub.com and create a pull request to suggest that the changes on the opinions branch should be merged into the main branch.</li>
<li>Accept the pull request you opened to merge your changes from the <code>opinions</code> branch into the <code>main</code> branch.</li>
</ul></li>
</ol>
<pre><code>curl https://raw.githubusercontent.com/UBC-DSCI/dsci-310-student/main/src/create_conflict.sh \
--output \
create_conflict.sh</code></pre>
<ol start="3" type="1">
<li>Once you have the script on your computer, run the script to prepare your repository by running the command below:</li>
</ol>
<pre class="shell"><code>bash create_conflict.sh</code></pre>
<ul>
<li>If you get <code>permission denied</code> after attempting to run the script, run <code>chmod +x create_conflict.sh</code> to add permissions to execute this file.</li>
</ul>
<h4 id="step-4-merge-your-branches-by-fixing-conflicts">Step 4: Merge your branches by fixing conflicts</h4>
<p>Resolve the merge conflict, by merging <code>branch_2</code> into <code>main</code> and then merge <code>branch_1</code> into <code>main</code> such that the README.md file on <code>main</code> reads as:</p>
<pre><code># DSCI 310 Individual Assignment 2
Changes to branch_2 commit 1
Changes to branch_1 commit 2</code></pre>
<h2 id="submission-instructions">Submission Instructions</h2>
<p>You will submit a PDF to Gradescope for individual assignment 1 that includes:</p>
<ol type="1">
<li>Refresh the remote repository on github.
<ul>
<li>You should see that the remote repository is no longer empty and has two new branches.</li>
</ul></li>
<li>Create your two pull requests</li>
<li>Merge both your pull requests into the <code>main</code> branch
<ul>
<li>This will create a merge conflict in one of the PRs and you will need to resolove this for this assignment.</li>
</ul></li>
<li>Feel free to resolve the conflict locally or by using the web editor,
but we’d recommend resolving it locally to get used to the process
(it is generally easier to resolve the conflicts locally if the merge conflict is more complicated).</li>
<li>the URL of the commit history of GitHub.com repository you created and worked on for this assignment (it will be something like: <code>https://github.com/&lt;YOURUSERNAME&gt;/learning-about-version-control/commits/main</code>)</li>
<li>the screenshot of your resolved merge conflict</li>
<li>an explanation (2-3 sentences and in your own words) of why it is useful to work in a branch-pull-request workflow instead of working by directly committing each change to the main branch.</li>
</ol>
<p><br></p>
<p>If you’re curious about the resulting repository structure, in Terminal/Git Bash, you can run:</p>
<pre><code>git log --oneline --graph --all</code></pre>
<p>Your output might look something like this (but could also be slightly different):</p>
<pre><code>* 4086b5a (HEAD -&gt; main, origin/main, origin/HEAD) Merge pull request #2 from jbourak/branch_2
|\
| * 48b40a0 (origin/branch_2) Merge branch &#39;main&#39; into branch_2
| |\
| |/
|/|
* | 5388caa Merge pull request #1 from jbourak/branch_1
|\ \
| * | 19a3d05 (origin/branch_1, branch_1) branch_1 commit 2
| * | ac17f0e branch_1 commit 1
|/ /
| * d2f6dd1 (branch_2) branch_2 commit 2
| * 8a32bfc branch_2 commit 1
|/
* f6ea48a Changes to main
* b89ee34 Initial commit</code></pre>
<p>We have two branches that branch off of main at the same point,
and each branch has two commits.</p>
<h4 id="step-5-submit">Step 5: Submit</h4>
<p>When you are done, submit a valid URL to your github repository.
For example, <code>https://github.com/chendaniely/dsci-310-assign2</code>.
Do not put any extra characters or words, we only need the full URL.</p>
<p>Please make our lives easier by submitting a URL that we can just click.</p>
<h2 id="rubric">Rubric</h2>
<p>This assignment will be graded for completion as follows:</p>
<table>
Expand All @@ -2642,35 +2563,27 @@ <h2 id="rubric">Rubric</h2>
<tbody>
<tr class="odd">
<td>100%</td>
<td>2 pull requests merged cleanly</td>
</tr>
<tr class="even">
<td>75%</td>
<td>2 pull requests merged but has lingering merge conflict markers</td>
</tr>
<tr class="odd">
<td>50%</td>
<td>1 pull request merged</td>
<td>GitHub history (check under pull request tab in repo) indicates a successfully merged pull request from opinions into main, clearly demonstrated solving the merge conflict in screenshot and well explained why it is useful to work in a branch-pull-request workflow</td>
</tr>
<tr class="even">
<td>25%</td>
<td>2 Pull Requests created</td>
<td>-25%</td>
<td>GitHub history (check under pull request tab in repo) does not indicate a successfully merged pull request from opinions into main</td>
</tr>
<tr class="odd">
<td>15%</td>
<td>Sucessfuly able to run the <code>create_conflict.sh</code> script</td>
<td>-25%</td>
<td>Did not clearly demonstrate solving the merge conflict in screenshot.</td>
</tr>
<tr class="even">
<td>10%</td>
<td>Repository created</td>
<td>-25%</td>
<td>Did not well explain why it is useful to work in a branch-pull-request workflow.</td>
</tr>
<tr class="odd">
<td>0%</td>
<td>-100%</td>
<td>No repository or attempt</td>
</tr>
</tbody>
</table>
<div class="sourceCode" id="cb7"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
<!--radix_placeholder_article_footer-->
<!--/radix_placeholder_article_footer-->
</div>
Expand Down

0 comments on commit 00c87a8

Please sign in to comment.