@@ -123,7 +123,11 @@ https://github.com/alice/sage.
123
123
124
124
Next if you don't have a local Git repo of Sage, then start afresh `cloning
125
125
your fork
126
- <https://docs.github.com/en/get-started/quickstart/fork-a-repo#cloning-your-forked-repository> `_::
126
+ <https://docs.github.com/en/get-started/quickstart/fork-a-repo#cloning-your-forked-repository> `_:
127
+
128
+ .. tab :: Using HTTPS
129
+
130
+ ::
127
131
128
132
[alice@localhost ~]$ git clone https://github.com/alice/sage.git
129
133
Cloning into 'sage'...
@@ -139,7 +143,30 @@ your fork
139
143
origin https://github.com/alice/sage.git (fetch)
140
144
origin https://github.com/alice/sage.git (push)
141
145
142
- If you already have a local Git repo and only want to link your fork as ``origin `` remote, then do::
146
+ .. tab :: By SSH protocol
147
+
148
+ ::
149
+
150
+ [alice@localhost ~]$ git clone [email protected] :alice/sage.git
151
+ Cloning into 'sage'...
152
+ remote: Enumerating objects: 914565, done.
153
+ remote: Counting objects: 100% (2738/2738), done.
154
+ remote: Compressing objects: 100% (855/855), done.
155
+ remote: Total 914565 (delta 1950), reused 2493 (delta 1875), pack-reused 911827
156
+ Receiving objects: 100% (914565/914565), 331.09 MiB | 11.22 MiB/s, done.
157
+ Resolving deltas: 100% (725438/725438), done.
158
+ Updating files: 100% (9936/9936), done.
159
+ [alice@localhost ~]$ cd sage
160
+ [alice@localhost sage]$ git remote -v
161
+ origin [email protected] :alice/sage.git (fetch)
162
+ origin [email protected] :alice/sage.git (push)
163
+
164
+
165
+ If you already have a local Git repo and only want to link your fork as ``origin `` remote, then do:
166
+
167
+ .. tab :: Using HTTPS
168
+
169
+ ::
143
170
144
171
[alice@localhost sage]$ git remote add origin https://github.com/alice/sage.git
145
172
[alice@localhost sage]$ git remote -v
@@ -155,7 +182,29 @@ If you already have a local Git repo and only want to link your fork as ``origin
155
182
From https://github.com/alice/sage
156
183
* [new branch] develop -> origin/develop
157
184
158
- You also add the Sage repo ``sagemath/sage `` as your remote ``upstream ``::
185
+ .. tab :: By SSH protocol
186
+
187
+ ::
188
+
189
+ [alice@localhost sage]$ git remote add origin [email protected] :alice/sage.git
190
+ [alice@localhost sage]$ git remote -v
191
+ origin [email protected] :alice/sage.git (fetch)
192
+ origin [email protected] :alice/sage.git (push)
193
+ [alice@localhost sage]$ git fetch origin
194
+ remote: Enumerating objects: 1136, done.
195
+ remote: Counting objects: 100% (1084/1084), done.
196
+ remote: Compressing objects: 100% (308/308), done.
197
+ remote: Total 1136 (delta 825), reused 982 (delta 776), pack-reused 52
198
+ Receiving objects: 100% (1136/1136), 2.62 MiB | 5.30 MiB/s, done.
199
+ Resolving deltas: 100% (838/838), completed with 145 local objects.
200
+
201
+ * [new branch] develop -> origin/develop
202
+
203
+ You also add the Sage repo ``sagemath/sage `` as your remote ``upstream ``:
204
+
205
+ .. tab :: Using HTTPS
206
+
207
+ ::
159
208
160
209
[alice@localhost sage]$ git remote add upstream https://github.com/sagemath/sage.git
161
210
[alice@localhost sage]$ git remote -v
@@ -164,19 +213,16 @@ You also add the Sage repo ``sagemath/sage`` as your remote ``upstream``::
164
213
upstream https://github.com/sagemath/sage.git (fetch)
165
214
upstream https://github.com/sagemath/sage.git (push)
166
215
216
+ .. tab :: By SSH protocol
167
217
168
- .. NOTE ::
169
-
170
- If you linked your Git to GitHub by SSH protocol, then do the following
171
- instead to set up remotes::
218
+ ::
172
219
173
- [alice@localhost sage]$ git remote add origin [email protected] :alice/sage.git
174
- [alice@localhost sage]$ git remote add upstream [email protected] :sagemath/sage.git
175
- [alice@localhost sage]$ git remote -v
176
- origin [email protected] :alice/sage.git (fetch)
177
- origin [email protected] :alice/sage.git (push)
178
- upstream [email protected] :sagemath/sage.git (fetch)
179
- upstream [email protected] :sagemath/sage.git (push)
220
+ [alice@localhost sage]$ git remote add upstream [email protected] :sagemath/sage.git
221
+ [alice@localhost sage]$ git remote -v
222
+ origin [email protected] :alice/sage.git (fetch)
223
+ origin [email protected] :alice/sage.git (push)
224
+ upstream [email protected] :sagemath/sage.git (fetch)
225
+ upstream [email protected] :sagemath/sage.git (push)
180
226
181
227
To prevent accidental pushes to ``upstream `` (instead of ``origin ``), you may want to disable it by running::
182
228
0 commit comments