You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.8 KiB
68 lines
2.8 KiB
12 months ago
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>Lab 2: Working with Git</title>
|
||
|
<link rel="stylesheet" href="../labGuide.css">
|
||
|
<style>
|
||
|
img {
|
||
|
border: 1px solid black;
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<div id="page">
|
||
|
<h1>Lab 2: Working with Git</h1>
|
||
|
<p>In this lab you get a better understanding of how Git works.</p>
|
||
|
|
||
|
<h2>Git tutorial</h2>
|
||
|
<p>
|
||
|
Open up <a href="https://learngitbranching.js.org">this interactive Git tutorial</a> and do the 4 lessons under "Introduction Sequence", as well as the 8 lessons under the "Remotes" tab: "Push & Pull -- Git Remotes!"
|
||
|
</p>
|
||
|
<h3>Tips</h3>
|
||
|
<ul>
|
||
|
<li>The tutorial has keyboard commands for most actions:
|
||
|
<ul>
|
||
|
<li><code>reset</code></li>
|
||
|
<li><code>undo</code></li>
|
||
|
<li><code>show goal</code></li>
|
||
|
<li><code>hide goal</code></li>
|
||
|
<li><code>show objectives</code></li>
|
||
|
<li><code>levels</code></li>
|
||
|
<li><code>level intro2</code></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>In the demonstrations, sometimes you have to scroll down to see everything.</li>
|
||
|
</ul>
|
||
|
<h3>Commands</h3>
|
||
|
<p>Here are the commands that are relevant for this tutorial:</p>
|
||
|
<ul>
|
||
|
<li><code>git commit</code> - makes a new commit.</li>
|
||
|
<li><code>git branch <em>branchName</em></code> - makes a new branch.</li>
|
||
|
<li><code>git checkout <em>branchName</em></code> - changes to the given branch.</li>
|
||
|
<li><code>git checkout -b <em>branchName</em></code> - <strong>creates and</strong> changes to the given branch.</li>
|
||
|
<li><code>git merge <em>branchName</em></code> - merges the given branch in with the current one.</li>
|
||
|
<li><code>git rebase <em>branchName</em></code> - make it look as though the current branch was derived directly from the given branch.</li>
|
||
|
<li><code>git clone</code> - makes a local copy of a remote repository</li>
|
||
|
<li><code>git fetch</code> - updates commits and remote branches according to the remote repository</li>
|
||
|
<li><code>git pull</code> - does a fetch then merges local with remote branches</li>
|
||
|
<li><code>git pull --rebase</code> - shorthand for fetch and rebase</li>
|
||
|
<li><code>git fakeTeamwork <em>[branchName]</em> <em>[numberOfCommits]</em></code> - specific to the tutorial: does a commit on the remote repository as if someone else is working on it</li>
|
||
|
<li><code>git push</code> - uploads your commits to a remote repository</li>
|
||
|
</ul>
|
||
|
|
||
|
<hr>
|
||
|
|
||
|
<p>When you are done, show that you have completed the tutorials to get credit.</p>
|
||
|
|
||
|
<hr>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</body>
|
||
|
|
||
|
</html>
|