-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall-git.html
More file actions
224 lines (196 loc) · 7.43 KB
/
install-git.html
File metadata and controls
224 lines (196 loc) · 7.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<p>
<a href="https://git-scm.com">Git</a> is a <em>version control system</em>: it
allows you to track modifications to your code, and to remember past versions
of it, and work with multiple current versions. It also allows multiple people
to be working on the same code. In this course, though, the key feature is
that the GitHub website "speaks git": your local git (via VS Code) will send
your code to GitHub, and you'll use that for submitting assignments.
</p>
<p>
(If you are using Linux, you probably already have git installed. And if you
don’t, then you probably enjoy puzzling out installations for yourself
anyway.)
</p>
<div class="intel-mac apple-silicon-mac other-platform">
<p><strong>Mac (Intel and Apple Silicon):</strong></p>
<ol>
<li id="f2g3h4">
<a href="#f2g3h4" class="anchor-link" aria-label="Link to this item"></a>
<p>
Open Spotlight by pressing <strong>command-space</strong>, or by
<strong>clicking the magnifying glass icon</strong> in the far upper
right of your screen:
</p>
<img
src="images/install-git-macos-spotlight.png"
width="263"
alt="the macOS Spotlight icon"
/>
</li>
<li id="i5j6k7">
<a href="#i5j6k7" class="anchor-link" aria-label="Link to this item"></a>
<p>
Type the word “<strong>Terminal</strong>” into the search box that
appears.
</p>
</li>
<li id="l8m9n1">
<a href="#l8m9n1" class="anchor-link" aria-label="Link to this item"></a>
<p>
The "top hit" should be an application called Terminal.
<strong>Open it</strong>.
<img
src="images/install-git-macos-terminal-search.png"
width="341"
alt="a macOS Spotlight search for 'terminal'"
/>
</p>
</li>
<li id="o2p3q4">
<a href="#o2p3q4" class="anchor-link" aria-label="Link to this item"></a>
<p>In the window that appears, <strong>type the following</strong>:></p>
<pre><code>git --version</code></pre>
<p>
⚠️ <strong>CAUTION:</strong> be careful to type exactly what you see: a
space after the word “git,” then two dashes, then no space before the
word “version.” All of that matters.
</p>
</li>
<li id="r5s6t7">
<a href="#r5s6t7" class="anchor-link" aria-label="Link to this item"></a>
<p><strong>Press return</strong>.</p>
</li>
<li id="u8v9w0">
<a href="#u8v9w0" class="anchor-link" aria-label="Link to this item"></a>
<p>If you see a message like this:</p>
<pre><code style="font-size: 14px;">Last login: Wed Aug 13 11:23:58 on ttys000 dan@macos ~ % git --version
git version 2.48.1 (Apple Git-128)
dan@macos ~</code></pre>
<p>
...where it says “git version” followed by a version number, then you
already have git installed.
<a href="/?step=verify-git">Click here to skip to the next section.</a>
</p>
</li>
<li id="x1y2z3">
<a href="#x1y2z3" class="anchor-link" aria-label="Link to this item"></a>
<p>
If and <strong>only if</strong> you see a big error message that
includes “<strong>No developer tools found</strong>” or “<strong
>invalid active developer path</strong
>,” then do the following:
</p>
<ol type="a">
<li>
Copy and paste this into the Terminal, and press return:
<pre><code>sudo xcode-select --reset</code></pre>
</li>
<li>
It will ask for your computer password.
<strong>You won’t be able to see your own typing</strong>, but it is
working! Type your password and press return.
</li>
<li>
Now copy and paste this into the Terminal:
<pre><code>xcode-select --install</code></pre>
</li>
<li>
<p>
You should now see a message like this.
<strong>Click Install</strong> and follow the instructions.<br />
<img
src="images/install-git-macos-install-dev-tools.png"
width="441"
alt="dialog box that says the 'git' command requires command line
developer tools, do you want to install them?"
/>
</p>
<p>
If you get a message about being unable to reach a server, please
see the Windows section below (hover over it to make it easier to
read).
</p>
</li>
<li>
<p>
The installation will take a few minutes. When it’s done, go back to
that Terminal window and try typing
<code>git --version</code> again. You should now get a version
number like the screenshot above.
</p>
</li>
</ol>
</li>
</ol>
</div>
<div class="win other-platform">
<p><strong>Windows:</strong></p>
<ol type="1">
<li id="a4b5c6">
<a href="#a4b5c6" class="anchor-link" aria-label="Link to this item"></a>
Go to
<a href="http://git-scm.com/downloads">http://git-scm.com/downloads</a
><br />
</li>
<li id="d7e8f9">
<a href="#d7e8f9" class="anchor-link" aria-label="Link to this item"></a>
<strong>Click the Download button</strong> for the latest release (which
might have a newer version number than the one in this screenshot):
<img
src="images/install-git-win-download.png"
width="314"
alt="screenshot from
the git download page showing the button to download the latest
release of git"
/>
</li>
<li id="g0h1i2">
<a href="#g0h1i2" class="anchor-link" aria-label="Link to this item"></a>
<strong>Open/Run</strong> the downloaded installer.
</li>
<li id="j3k4l5">
<a href="#j3k4l5" class="anchor-link" aria-label="Link to this item"></a>
<p>
Windows may ask you if you want Git for Windows to be able to make
changes to your device. <strong>Click yes</strong>.
</p>
<img
src="images/install-git-win-make-changes.png"
width="500"
alt="Windows dialog box asking if Git for Windows can make changes to
your device"
/>
</li>
<li id="m6n7o8">
<a href="#m6n7o8" class="anchor-link" aria-label="Link to this item"></a>
<p>
You can click through <em>most</em> of the defaults by clicking “Next,”
⚠️<strong>EXCEPT FOR TWO</strong>: when you get to the “Choosing the
default editor used by Git” step,
<strong>select Visual Studio Code</strong>.
</p>
<img
src="images/install-git-win-default-editor.png"
alt="dialog box for selecting the default editor used by git"
/>
</li>
<li id="p9q0r1">
<a href="#p9q0r1" class="anchor-link" aria-label="Link to this item"></a>
<p>
When asked about the “initial branch name in new repositories”, please
choose <strong>Override the default:</strong> and set the initial name
to "main":
</p>
<img
src="images/install-git-win-initial-branch.png"
alt="dialog for adjusting the name of the initial branch in new
git repositories, overriding it to be 'main'"
/>
</li>
<li id="s2t3u4">
<a href="#s2t3u4" class="anchor-link" aria-label="Link to this item"></a>
After this, <strong>click Next</strong> many, many times to accept all the
default options.<br />
</li>
</ol>
</div>