1
00:00:02,050 --> 00:00:05,250
I'm back in the collaborator account,

2
00:00:05,250 --> 00:00:07,040
as I called it. And as you know,

3
00:00:07,040 --> 00:00:10,800
this collaborator now has access to this

4
00:00:10,800 --> 00:00:12,923
private repository in here.

5
00:00:13,850 --> 00:00:17,000
Besides collaboration, we also have the concept

6
00:00:17,000 --> 00:00:19,980
of contribution in GitHub.

7
00:00:19,980 --> 00:00:23,830
Contribution is something you can see in open-source

8
00:00:23,830 --> 00:00:27,730
projects. This means projects where the code,

9
00:00:27,730 --> 00:00:29,280
the underlying source code

10
00:00:29,280 --> 00:00:31,790
of a website, for example,

11
00:00:31,790 --> 00:00:34,050
or of a programming language,

12
00:00:34,050 --> 00:00:36,330
is shared publicly,

13
00:00:36,330 --> 00:00:39,235
and where anybody can implement

14
00:00:39,235 --> 00:00:42,173
new features or fix bugs in there.

15
00:00:43,200 --> 00:00:45,620
Of course, the process of such an

16
00:00:45,620 --> 00:00:48,000
open-source project and how people

17
00:00:48,000 --> 00:00:51,840
can contribute to it has to be well-structured.

18
00:00:51,840 --> 00:00:54,180
Otherwise, anybody could basically

19
00:00:54,180 --> 00:00:57,300
push any kind of code to this project.

20
00:00:57,300 --> 00:01:00,020
The structure of such an open-source project

21
00:01:00,020 --> 00:01:02,740
is not the core focus of this course, though.

22
00:01:02,740 --> 00:01:05,190
I just want to show you how you

23
00:01:05,190 --> 00:01:09,070
can contribute to open-source projects.

24
00:01:09,070 --> 00:01:12,330
Meaning, how can you suggest that your

25
00:01:12,330 --> 00:01:14,830
code changes should be implemented

26
00:01:14,830 --> 00:01:17,600
to an existing GitHub project

27
00:01:17,600 --> 00:01:20,073
without being a collaborator?

28
00:01:21,120 --> 00:01:25,069
For this, I'll go back to the owner account

29
00:01:25,069 --> 00:01:26,230
that I created.

30
00:01:26,230 --> 00:01:28,190
So here again, I'm in Chrome.

31
00:01:28,190 --> 00:01:30,933
So I am in my mLoAM account.

32
00:01:31,780 --> 00:01:36,170
In there, I'll go to the landing page of this repository,

33
00:01:36,170 --> 00:01:40,640
there, to the repositories ribbon,

34
00:01:40,640 --> 00:01:43,700
and there I'll create a new repository.

35
00:01:43,700 --> 00:01:45,260
Let's create a new one.

36
00:01:45,260 --> 00:01:50,260
And I'll call this "open-source" now

37
00:01:51,450 --> 00:01:54,560
and this project will be a public project.

38
00:01:54,560 --> 00:01:57,923
And with that, we can actually create this repository.

39
00:02:00,430 --> 00:02:03,200
In this project. I'll again, add a new file,

40
00:02:03,200 --> 00:02:05,180
a new dummy file,

41
00:02:05,180 --> 00:02:09,780
which I'll call "initial-code.txt."

42
00:02:12,087 --> 00:02:15,350
And also name the commit accordingly.

43
00:02:15,350 --> 00:02:19,730
So "added initial code,"

44
00:02:19,730 --> 00:02:21,023
and I'll commit this.

45
00:02:22,220 --> 00:02:23,900
Nothing new so far.

46
00:02:23,900 --> 00:02:26,330
If I now go back to the other account,

47
00:02:26,330 --> 00:02:29,000
so to the earlier collaborator account

48
00:02:30,260 --> 00:02:33,253
here, and go to this mLoAM page,

49
00:02:35,400 --> 00:02:39,330
then I can see these two public repositories,

50
00:02:39,330 --> 00:02:43,290
but keep in mind that although I can see and access this

51
00:02:43,290 --> 00:02:46,740
repository here and I could, of course, also clone it,

52
00:02:46,740 --> 00:02:49,860
if I would like to push to this repository,

53
00:02:49,860 --> 00:02:52,690
then this would not be possible

54
00:02:52,690 --> 00:02:54,640
because this repository is

55
00:02:54,640 --> 00:02:57,760
not part of this user account.

56
00:02:57,760 --> 00:02:59,800
It is owned by another account,

57
00:02:59,800 --> 00:03:03,710
and therefore I don't have the rights to push to it.

58
00:03:03,710 --> 00:03:05,550
If the other person would add me

59
00:03:05,550 --> 00:03:08,390
as collaborator, yes, then this would work.

60
00:03:08,390 --> 00:03:12,090
Then I would be part of this repository search you say,

61
00:03:12,090 --> 00:03:14,370
but in this case I can only access it,

62
00:03:14,370 --> 00:03:16,870
but not contribute to it.

63
00:03:16,870 --> 00:03:20,220
Therefore contributing to open source projects

64
00:03:20,220 --> 00:03:22,420
works a bit differently.

65
00:03:22,420 --> 00:03:25,550
Because if we would be able to bring this

66
00:03:25,550 --> 00:03:29,340
project to our own repository,

67
00:03:29,340 --> 00:03:34,340
so basically, in our user account, your repositories.

68
00:03:34,630 --> 00:03:36,870
So if this project would be here,

69
00:03:36,870 --> 00:03:39,500
don't get distracted by these projects here.

70
00:03:39,500 --> 00:03:43,210
These are not related to this course here.

71
00:03:43,210 --> 00:03:44,820
So if we would have access

72
00:03:45,890 --> 00:03:47,890
to this repository in here,

73
00:03:47,890 --> 00:03:50,800
then it would be part of our user account,

74
00:03:50,800 --> 00:03:54,120
and then we would be able to push to this project

75
00:03:54,120 --> 00:03:57,300
even without having the personal access token

76
00:03:57,300 --> 00:03:59,890
required to do so actually.

77
00:03:59,890 --> 00:04:02,690
Well, for this, I'll go back now

78
00:04:03,820 --> 00:04:06,330
to the mLoAM repository, in my case,

79
00:04:06,330 --> 00:04:08,350
and to this open source project.

80
00:04:08,350 --> 00:04:13,350
And here I will now go to this fork option over here.

81
00:04:14,550 --> 00:04:17,267
As you can see by hovering over it

82
00:04:17,267 --> 00:04:19,029
"fork" here means that we can

83
00:04:19,029 --> 00:04:24,030
fork our own copy of this repository to our own account.

84
00:04:24,570 --> 00:04:28,430
So we create a complete copy of this project,

85
00:04:28,430 --> 00:04:32,210
which will then become part of our GitHub account.

86
00:04:32,210 --> 00:04:36,500
And therefore this copy will not be related at all to the

87
00:04:36,500 --> 00:04:40,490
repository, which is part of the owner account.

88
00:04:40,490 --> 00:04:42,090
So to keep things simple,

89
00:04:42,090 --> 00:04:45,330
keep in mind that currently this open source project

90
00:04:45,330 --> 00:04:48,413
is linked to this mLoAM account here.

91
00:04:49,460 --> 00:04:51,177
If we now press "fork,"

92
00:04:52,500 --> 00:04:56,600
then we can choose where we should fork this project to,

93
00:04:56,600 --> 00:04:58,160
this Academind account here

94
00:04:58,160 --> 00:05:01,480
is nothing you should worry about here,

95
00:05:01,480 --> 00:05:03,520
It's all about this Manulorenz account.

96
00:05:03,520 --> 00:05:05,460
So this account I'm currently using.

97
00:05:05,460 --> 00:05:07,063
So let me select this.

98
00:05:09,090 --> 00:05:11,220
And now the forging takes a few seconds.

99
00:05:11,220 --> 00:05:12,593
This is totally normal.

100
00:05:14,760 --> 00:05:18,480
Now the fork was successful and if you now check

101
00:05:18,480 --> 00:05:21,290
the left part of this page,

102
00:05:21,290 --> 00:05:24,630
then you see that now Manulorenz is the owner of this

103
00:05:24,630 --> 00:05:26,553
open source repository.

104
00:05:27,500 --> 00:05:30,380
We see the information that this was forked from, well,

105
00:05:30,380 --> 00:05:31,890
another repository.

106
00:05:31,890 --> 00:05:35,130
This is something we'll dive into in a few minutes,

107
00:05:35,130 --> 00:05:40,053
but generally now we have full access to this project.

108
00:05:40,950 --> 00:05:45,140
And as we have created a personal access token

109
00:05:45,140 --> 00:05:46,450
in the last lecture,

110
00:05:46,450 --> 00:05:49,280
to be able to access this GitHub account

111
00:05:49,280 --> 00:05:53,520
locally from this computer, with our Git project,

112
00:05:53,520 --> 00:05:55,710
well, then we should be able now to

113
00:05:55,710 --> 00:05:58,340
clone this project and to implement

114
00:05:58,340 --> 00:06:00,790
a change to this code, for example,

115
00:06:00,790 --> 00:06:04,180
which could be a back fix in the real world

116
00:06:04,180 --> 00:06:07,273
or a new feature, which you might want to implement.

117
00:06:08,200 --> 00:06:09,033
To do this,

118
00:06:09,033 --> 00:06:11,320
we'll follow our good old approach

119
00:06:11,320 --> 00:06:13,200
of clicking onto code and

120
00:06:13,200 --> 00:06:16,850
copying the URL of this repository now again,

121
00:06:16,850 --> 00:06:20,370
which is part of this user account now.

122
00:06:20,370 --> 00:06:23,210
Now I'll create a new folder and open a new

123
00:06:23,210 --> 00:06:24,950
visual studio code instance.

124
00:06:24,950 --> 00:06:27,433
We know how this process works in the meanwhile.

125
00:06:28,420 --> 00:06:31,870
So here I created a folder named "fork,"

126
00:06:31,870 --> 00:06:34,790
and now I'll simply clone

127
00:06:34,790 --> 00:06:37,240
the repository into this folder,

128
00:06:37,240 --> 00:06:39,010
again with a space and a dot

129
00:06:39,010 --> 00:06:41,210
to have the same structure in here

130
00:06:41,210 --> 00:06:42,913
inside this fork folder.

131
00:06:45,250 --> 00:06:49,023
And now we have this initial code text file.

132
00:06:49,860 --> 00:06:51,390
And now, what I could do is

133
00:06:51,390 --> 00:06:54,800
I could create another text file

134
00:06:54,800 --> 00:06:59,723
named "added-new-feature.txt," for example,

135
00:07:01,477 --> 00:07:03,917
and there I could add a change. Well,

136
00:07:03,917 --> 00:07:08,540
"New feature added" to have some texts in there,

137
00:07:08,540 --> 00:07:10,520
which I can save now.

138
00:07:10,520 --> 00:07:13,610
Now I'll add this to the staging area

139
00:07:13,610 --> 00:07:14,810
and I'll commit this

140
00:07:16,417 --> 00:07:20,077
"implemented new feature."

141
00:07:22,760 --> 00:07:24,180
And now,

142
00:07:24,180 --> 00:07:27,490
well, I can push this to my repository, right?

143
00:07:27,490 --> 00:07:30,860
As I said, we have the required access to my account,

144
00:07:30,860 --> 00:07:33,760
which now holds the forked repository,

145
00:07:33,760 --> 00:07:38,760
therefore with "git push origin main,"

146
00:07:39,500 --> 00:07:41,830
well, this should be possible.

147
00:07:41,830 --> 00:07:43,223
Let's see if this works.

148
00:07:44,190 --> 00:07:46,640
Yeah, no errors, nothing like this.

149
00:07:46,640 --> 00:07:49,673
So by going back to GitHub now,

150
00:07:51,010 --> 00:07:54,250
to the account that holds the fork repository,

151
00:07:54,250 --> 00:07:56,353
and if we now reload this page,

152
00:07:57,870 --> 00:08:01,140
you see that we added this new feature text file,

153
00:08:01,140 --> 00:08:02,483
nothing new so far.

154
00:08:04,350 --> 00:08:07,140
The question now is how can we inform

155
00:08:07,140 --> 00:08:11,980
the actual owner of the real repository? So to say.

156
00:08:11,980 --> 00:08:14,670
So basically the owner of this open source repo.

157
00:08:14,670 --> 00:08:16,760
So this mLoAM account.

158
00:08:16,760 --> 00:08:18,720
So how can be informed this user

159
00:08:18,720 --> 00:08:21,270
about the fact that we added a new feature,

160
00:08:21,270 --> 00:08:23,980
and that will request him to implement this

161
00:08:23,980 --> 00:08:26,763
new feature to his open source project?

162
00:08:27,770 --> 00:08:31,680
Well, for this, we have to create a so-called

163
00:08:31,680 --> 00:08:33,600
pull request.

164
00:08:33,600 --> 00:08:37,039
You saw pull in the last lecture, pulling meant,

165
00:08:37,039 --> 00:08:40,429
basically updating and implementing

166
00:08:40,429 --> 00:08:44,890
the latest changes from GitHub locally on Git.

167
00:08:44,890 --> 00:08:47,870
Here, "pull requests" simply mean

168
00:08:47,870 --> 00:08:51,430
I request the owner of the initial repository

169
00:08:51,430 --> 00:08:55,300
to pull the changes I made on GitHub here

170
00:08:55,300 --> 00:08:59,283
and to implement those changes on his project on GitHub.

171
00:09:00,540 --> 00:09:03,513
Therefore, if we go to pull requests now,

172
00:09:05,040 --> 00:09:06,620
and over there,

173
00:09:06,620 --> 00:09:10,223
create a new pull request, it's over here, this option,

174
00:09:11,680 --> 00:09:14,810
we see that we have a base repository,

175
00:09:14,810 --> 00:09:17,820
which is part of this mLoAM account.

176
00:09:17,820 --> 00:09:21,110
So this is the initial owner of the repository.

177
00:09:21,110 --> 00:09:24,550
And on the other head, we have the head repository.

178
00:09:24,550 --> 00:09:28,870
This is the account where the forked repository lives in.

179
00:09:28,870 --> 00:09:31,410
So in the left part, we always have the repository

180
00:09:32,470 --> 00:09:35,000
where we request the pull, in the right part,

181
00:09:35,000 --> 00:09:36,640
we have our repository,

182
00:09:36,640 --> 00:09:39,240
so the repository of the person that

183
00:09:39,240 --> 00:09:41,333
initiates the pull request.

184
00:09:42,310 --> 00:09:43,690
If we scroll down a bit,

185
00:09:43,690 --> 00:09:47,220
we can also find some information about what we changed

186
00:09:47,220 --> 00:09:50,480
in this fork repository, not too much in our case,

187
00:09:50,480 --> 00:09:52,223
so this is quite straightforward.

188
00:09:54,530 --> 00:09:59,513
And now by clicking onto create pull request over here,

189
00:10:00,810 --> 00:10:05,320
we can give a short overview of well, what was changed.

190
00:10:05,320 --> 00:10:07,920
So with the headline here, so we implemented,

191
00:10:07,920 --> 00:10:12,920
for example, "teams page," something like this,

192
00:10:13,140 --> 00:10:14,640
And on there, you will then give

193
00:10:14,640 --> 00:10:16,290
the owner of the repository,

194
00:10:16,290 --> 00:10:18,430
a detailed description about what you did,

195
00:10:18,430 --> 00:10:20,530
what you changed and well,

196
00:10:20,530 --> 00:10:22,130
what the code is all about.

197
00:10:22,130 --> 00:10:24,330
Not required for us here at the moment,

198
00:10:24,330 --> 00:10:27,400
as it's just an example pull request here.

199
00:10:27,400 --> 00:10:29,410
Therefore we can simply continue

200
00:10:29,410 --> 00:10:31,980
with creating the pull requests down here.

201
00:10:31,980 --> 00:10:33,083
So let's do this.

202
00:10:34,330 --> 00:10:37,090
And now you'll see that this pull request

203
00:10:37,090 --> 00:10:39,540
was obviously successful. So it is an

204
00:10:39,540 --> 00:10:41,560
open pull request now.

205
00:10:41,560 --> 00:10:43,970
And if we now switch back to the account

206
00:10:43,970 --> 00:10:47,080
that owns the initial repository,

207
00:10:47,080 --> 00:10:49,470
so this account here in my case,

208
00:10:49,470 --> 00:10:51,463
and if I now reload this page,

209
00:10:52,780 --> 00:10:55,650
you see that we have one open pull request

210
00:10:55,650 --> 00:10:58,040
indicated by this symbol here.

211
00:10:58,040 --> 00:11:00,443
And we can, of course now switch to this ribbon.

212
00:11:02,410 --> 00:11:05,710
And in there we see now that we have this open pull request

213
00:11:05,710 --> 00:11:07,970
here we see the headline we created,

214
00:11:07,970 --> 00:11:09,263
let's now access it.

215
00:11:10,880 --> 00:11:13,440
And then there, we can all dive deeper

216
00:11:13,440 --> 00:11:15,700
into the pull request, what was made,

217
00:11:15,700 --> 00:11:16,720
and so on.

218
00:11:16,720 --> 00:11:19,180
As I said, for us, it's pretty straightforward.

219
00:11:19,180 --> 00:11:20,890
We don't have any big changes.

220
00:11:20,890 --> 00:11:22,610
We just added a new file.

221
00:11:22,610 --> 00:11:25,850
So we won't dive deeper into this here,

222
00:11:25,850 --> 00:11:28,550
but we have two important options here.

223
00:11:28,550 --> 00:11:31,780
One would be to close the pull request.

224
00:11:31,780 --> 00:11:34,090
This simply means that we do not agree.

225
00:11:34,090 --> 00:11:36,670
So we are not happy with these changes,

226
00:11:36,670 --> 00:11:39,500
and we don't want to implement these

227
00:11:39,500 --> 00:11:41,440
into our project.

228
00:11:41,440 --> 00:11:44,580
Or if we say yes, this is a nice change,

229
00:11:44,580 --> 00:11:48,270
a nice addition, a nice bug fix, anything like that.

230
00:11:48,270 --> 00:11:51,300
Then we can merge this pull request.

231
00:11:51,300 --> 00:11:53,730
You remember merging from this module

232
00:11:53,730 --> 00:11:55,500
means basically bringing the

233
00:11:55,500 --> 00:11:57,930
changes of two branches together,

234
00:11:57,930 --> 00:12:00,980
which is actually what is also happening right here,

235
00:12:00,980 --> 00:12:03,440
in the case of a pull request,

236
00:12:03,440 --> 00:12:06,550
merge the state of the project,

237
00:12:06,550 --> 00:12:08,650
of the forked repository

238
00:12:08,650 --> 00:12:10,770
and the main branch in there, in our case,

239
00:12:10,770 --> 00:12:13,990
with the initial repository in the main branch.

240
00:12:13,990 --> 00:12:16,400
So we'll merge this pull request now

241
00:12:16,400 --> 00:12:17,500
by confirming this

242
00:12:18,770 --> 00:12:20,963
once and twice here.

243
00:12:22,950 --> 00:12:26,040
And now with this, we see the confirmation up here

244
00:12:26,040 --> 00:12:28,690
with this purple symbol that we merged

245
00:12:29,600 --> 00:12:30,940
our projects.

246
00:12:30,940 --> 00:12:33,613
And by going back to the code ribbon over here,

247
00:12:36,320 --> 00:12:39,650
you see that "added new feature" is now also

248
00:12:39,650 --> 00:12:43,920
available in here. This is the pull request

249
00:12:43,920 --> 00:12:46,610
implemented successfully.

250
00:12:46,610 --> 00:12:48,990
And by going back to the other account,

251
00:12:48,990 --> 00:12:51,463
which initiated the pull request,

252
00:12:53,230 --> 00:12:55,270
well then there we can also see

253
00:12:55,270 --> 00:12:57,970
that our merge was successful.

254
00:12:57,970 --> 00:12:59,840
And with this, we've reached the end

255
00:12:59,840 --> 00:13:03,310
of this Git and GitHub introduction module.

256
00:13:03,310 --> 00:13:06,720
Now these are just the core basics of

257
00:13:06,720 --> 00:13:08,970
what Git and GitHub are all about.

258
00:13:08,970 --> 00:13:11,300
It is just important for you to understand

259
00:13:11,300 --> 00:13:13,380
that these tools are existing

260
00:13:13,380 --> 00:13:16,370
and how you can use these tools on your journey

261
00:13:16,370 --> 00:13:19,040
to become a web developer.

262
00:13:19,040 --> 00:13:21,150
Nevertheless, in the next lecture,

263
00:13:21,150 --> 00:13:23,350
I want to give you a quick summary

264
00:13:23,350 --> 00:13:24,610
of what you learned

265
00:13:24,610 --> 00:13:27,130
and also about how you can continue

266
00:13:27,130 --> 00:13:30,323
to dive deeper into Git and GitHub you want to.

