@@ -28,13 +28,11 @@ in GitLab.
28
28
* New GitLab repository for this user
29
29
* Configure local repository for the remote server
30
30
31
-
32
-
33
31
~~~SECTION:handouts~~~
34
32
35
33
****
36
34
37
- # SSH Keys
35
+ ** SSH Keys**
38
36
39
37
Generate a new SSH key pair on your client.
40
38
@@ -136,16 +134,26 @@ the changes to the Git repository.
136
134
* Steps
137
135
* Open the project in GitLab and extract the `HTTPS` clone URL
138
136
* Navigate into your local repository in `$HOME/training`
139
- * Use `git remote add origin <remoteurl>`
140
- * Push your local branch with `--set-upstream` (short: `-u`)
137
+ * Use `git remote add origin <https-remote-url>`
138
+ * Push local branches with `git push -u origin --all`
139
+
141
140
* Bonus
142
141
* Set default push method to `simple`
143
- * Explain what `git push -u origin --all` does suggested by GitLab
144
142
145
143
~~~SECTION:handouts~~~
146
144
147
145
****
148
146
147
+ There are various `push` methods:
148
+
149
+ * `simple` - pushes the current branch with the same name on the remote
150
+ * `current` - push the current branch to update a branch with the same name on the receiving end
151
+ * `nothing` - do not push anything (error out) unless a refspec is given
152
+
153
+ References:
154
+
155
+ https://git-scm.com/docs/git-config/#Documentation/git-config.txt-pushdefault
156
+
149
157
150
158
~~~ENDSECTION~~~
151
159
@@ -163,16 +171,14 @@ the changes to the Git repository.
163
171
164
172
* Open the project in GitLab and extract the `HTTPS` clone URL
165
173
* Navigate into your local repository
166
- * Use `git remote add origin <remoteurl>`
167
- * Push your local branch
168
- * Use `--set-upstream` (short: `-u`) to enable the local branch tracking the remote repository
174
+ * Use `git remote add origin <https-remote-url>`
175
+ * Push local branches with `git push -u origin --all`
169
176
170
177
## Bonus:
171
178
172
179
****
173
180
174
181
* Configure the default push method to `simple`
175
- * Explain what `git push -u origin --all` does suggested by GitLab
176
182
177
183
!SLIDE supplemental solutions
178
184
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Proposed Solution
@@ -198,7 +204,9 @@ This will not work since the local branch does not follow the remote branch.
198
204
Use `--set-upstream` as proposed by the cli output. Short form is `-u`.
199
205
200
206
@@@ Sh
201
- $ git push --set-upstream origin main
207
+ $ cd $HOME/training.git
208
+ $ git remote add origin https://[...].nws.netways.de/root/training.git
209
+ $ git push -u origin --all
202
210
203
211
### Set default push method
204
212
0 commit comments