1
00:00:02,070 --> 00:00:03,469
In contrast to Git,

2
00:00:03,469 --> 00:00:06,980
which is a local tool installed on your machine,

3
00:00:06,980 --> 00:00:08,810
GitHub is a website.

4
00:00:08,810 --> 00:00:10,870
This means you need to create an account,

5
00:00:10,870 --> 00:00:14,370
then you can login, and then you can use GitHub.

6
00:00:14,370 --> 00:00:17,750
Another difference between Git and GitHub is the fact

7
00:00:17,750 --> 00:00:22,750
that GitHub is not for free for all use cases.

8
00:00:22,830 --> 00:00:24,390
There is good news, though.

9
00:00:24,390 --> 00:00:28,853
If we go to this pricing tab up here and there to plans,

10
00:00:29,750 --> 00:00:33,150
you'll see that we have three different plans available.

11
00:00:33,150 --> 00:00:36,140
And while this highlighted most popular Team Plan,

12
00:00:36,140 --> 00:00:39,720
and this Enterprise Plan here are costly options,

13
00:00:39,720 --> 00:00:41,530
so these are not for free,

14
00:00:41,530 --> 00:00:44,030
we also have this Free Plan here to the right,

15
00:00:44,030 --> 00:00:47,170
and, turns out, that this doesn't cost a thing.

16
00:00:47,170 --> 00:00:50,540
The great thing is that the free plan is totally sufficient

17
00:00:50,540 --> 00:00:55,540
for basic use cases, for basic single user use cases,

18
00:00:55,720 --> 00:00:58,850
and also for smaller team projects.

19
00:00:58,850 --> 00:01:01,660
And this means this plan, this free plan,

20
00:01:01,660 --> 00:01:04,569
is totally sufficient for the purpose of this course

21
00:01:04,569 --> 00:01:07,533
and also for you to get started with GitHub.

22
00:01:08,370 --> 00:01:10,200
Therefore, what you can do now is,

23
00:01:10,200 --> 00:01:13,020
you can go to join for free down here

24
00:01:13,020 --> 00:01:16,113
or you'll scroll up and go to sign up.

25
00:01:17,320 --> 00:01:20,340
There you then enter your email, a username,

26
00:01:20,340 --> 00:01:22,180
and you select the password.

27
00:01:22,180 --> 00:01:25,350
And with this, you create your GitHub account.

28
00:01:25,350 --> 00:01:28,550
And if you then log into this account,

29
00:01:28,550 --> 00:01:31,180
then you can see this page here.

30
00:01:31,180 --> 00:01:34,510
This is your personal GitHub account page.

31
00:01:34,510 --> 00:01:37,660
So to say, sort of page where you can manage

32
00:01:37,660 --> 00:01:39,610
your GitHub account.

33
00:01:39,610 --> 00:01:41,970
And before we dive a bit deeper here,

34
00:01:41,970 --> 00:01:44,523
it's important to understand that by creating

35
00:01:44,523 --> 00:01:49,380
this GitHub account, you now have a public GitHub profile.

36
00:01:49,380 --> 00:01:53,640
So to say, so a profile, anybody can access.

37
00:01:53,640 --> 00:01:56,710
You can, of course, manage what is displayed,

38
00:01:56,710 --> 00:01:59,030
what is accessible on this page.

39
00:01:59,030 --> 00:02:01,420
But you have this profile page.

40
00:02:01,420 --> 00:02:06,420
And to access this page, you can simply go to this logo

41
00:02:06,450 --> 00:02:09,850
up here in your right top part of the page,

42
00:02:09,850 --> 00:02:12,963
and there you'll see your GitHub name that you used.

43
00:02:14,300 --> 00:02:17,500
If you now take this name and add it

44
00:02:17,500 --> 00:02:20,040
after he GitHub.com URL,

45
00:02:20,040 --> 00:02:22,900
so, a slash and then the name.

46
00:02:22,900 --> 00:02:26,190
So mloam in my case.

47
00:02:26,190 --> 00:02:27,823
And if I go to this page,

48
00:02:28,670 --> 00:02:33,090
then this is my both personal GitHub profile page,

49
00:02:33,090 --> 00:02:35,180
which you can access now.

50
00:02:35,180 --> 00:02:39,360
You see this page doesn't contain any public repositories.

51
00:02:39,360 --> 00:02:42,630
We'll dive into what these are in a few seconds.

52
00:02:42,630 --> 00:02:46,680
But, generally, this is the page of my GitHub account now,

53
00:02:46,680 --> 00:02:48,623
and you also have such a page.

54
00:02:49,740 --> 00:02:51,850
So this is the first thing to keep in mind,

55
00:02:51,850 --> 00:02:54,750
GitHub comes with a public profile here.

56
00:02:54,750 --> 00:02:57,880
As I said, we'll explore this in more detail

57
00:02:57,880 --> 00:02:59,730
throughout this lecture.

58
00:02:59,730 --> 00:03:04,240
First, I want to focus onto the way we can connect,

59
00:03:04,240 --> 00:03:07,090
Git and GitHub now, because in this course,

60
00:03:07,090 --> 00:03:10,580
we've worked on a local repository so far

61
00:03:10,580 --> 00:03:13,120
where we added our branches and our commits.

62
00:03:13,120 --> 00:03:17,720
And now the first goal would be to make sure that this

63
00:03:17,720 --> 00:03:22,720
local repository is now also available here in the cloud.

64
00:03:23,320 --> 00:03:26,840
Now, we have a big differentiation between repositories

65
00:03:26,840 --> 00:03:30,290
managed locally on Git versus repositories

66
00:03:30,290 --> 00:03:31,473
managed by our GitHub.

67
00:03:32,456 --> 00:03:35,940
Git repositories are called local repositories,

68
00:03:35,940 --> 00:03:40,570
GitHub repositories, so projects managed on GitHub,

69
00:03:40,570 --> 00:03:42,770
are called remote repositories.

70
00:03:42,770 --> 00:03:46,190
Remote because, well, they are basically accessible

71
00:03:46,190 --> 00:03:47,253
from anywhere.

72
00:03:48,090 --> 00:03:52,120
To establish the connection between these two repositories,

73
00:03:52,120 --> 00:03:57,120
we need both a local repository and a remote repository.

74
00:03:57,570 --> 00:03:59,280
This means in our case here,

75
00:03:59,280 --> 00:04:02,820
we first have to create such a remote repository,

76
00:04:02,820 --> 00:04:06,120
an empty remote repository, to be more precise,

77
00:04:06,120 --> 00:04:07,430
here on GitHub.

78
00:04:07,430 --> 00:04:09,550
And then we can establish the connection

79
00:04:09,550 --> 00:04:13,070
between Git and GitHub to be able to bring

80
00:04:13,070 --> 00:04:18,070
the local repository's content to this remote repository.

81
00:04:18,089 --> 00:04:20,490
Now, lots of repositories here,

82
00:04:20,490 --> 00:04:23,180
therefore, let's see how this works now,

83
00:04:23,180 --> 00:04:26,030
by creating this remote repository.

84
00:04:26,030 --> 00:04:28,460
We can do this either by selecting this

85
00:04:28,460 --> 00:04:31,163
Repositories option up here,

86
00:04:32,690 --> 00:04:35,883
there we could create a new repository over there,

87
00:04:36,760 --> 00:04:40,680
or if we click onto this, well, GitHub symbol here

88
00:04:40,680 --> 00:04:43,490
in the top left part of this page.

89
00:04:43,490 --> 00:04:45,640
Then we are back on the page we saw

90
00:04:45,640 --> 00:04:48,160
when starting GitHub the first time.

91
00:04:48,160 --> 00:04:50,740
There you can create the repository by clicking

92
00:04:50,740 --> 00:04:52,033
onto this new button.

93
00:04:52,920 --> 00:04:57,360
By the way, don't get distracted by this repository.

94
00:04:57,360 --> 00:04:59,690
You can see right here this is not related

95
00:04:59,690 --> 00:05:01,350
to this module of the course,

96
00:05:01,350 --> 00:05:03,283
so you can simply ignored this.

97
00:05:04,190 --> 00:05:05,893
So let's click onto New.

98
00:05:07,130 --> 00:05:10,230
And here we can now create a new repository.

99
00:05:10,230 --> 00:05:14,600
As I said, repository here refers to a remote repository,

100
00:05:14,600 --> 00:05:16,793
so a repository on GitHub.

101
00:05:17,790 --> 00:05:22,080
First, we have to give this remote repository a name here.

102
00:05:22,080 --> 00:05:26,873
I'll simply call it web-dev-github, maybe.

103
00:05:29,240 --> 00:05:30,940
There you also get the confirmation

104
00:05:30,940 --> 00:05:34,100
that this repository name is available.

105
00:05:34,100 --> 00:05:36,370
We could then add a description

106
00:05:36,370 --> 00:05:38,840
about what this repository contains.

107
00:05:38,840 --> 00:05:40,310
This is optional, though.

108
00:05:40,310 --> 00:05:42,493
Therefore, we'll omit this for the moment.

109
00:05:43,870 --> 00:05:45,720
Afterwards, we have the option to choose

110
00:05:45,720 --> 00:05:50,470
between a public repository and a private repository.

111
00:05:50,470 --> 00:05:54,310
If you think back about the profile page, I just showed you,

112
00:05:54,310 --> 00:05:58,330
so this public page you have when creating GitHub account,

113
00:05:58,330 --> 00:06:02,300
then public repositories would be visible there,

114
00:06:02,300 --> 00:06:04,950
private repositories, wouldn't.

115
00:06:04,950 --> 00:06:06,670
So for private repositories,

116
00:06:06,670 --> 00:06:08,740
it's up on you to decide who sees

117
00:06:08,740 --> 00:06:11,110
and who can interact with these repositories.

118
00:06:11,110 --> 00:06:12,710
For public ones, at least,

119
00:06:12,710 --> 00:06:15,370
the visibility part is set by default.

120
00:06:15,370 --> 00:06:20,310
Anybody can see this repository and the code it contains.

121
00:06:20,310 --> 00:06:21,230
So be careful,

122
00:06:21,230 --> 00:06:24,090
but to choose right here for the purpose of this course,

123
00:06:24,090 --> 00:06:25,230
we have nothing to hide.

124
00:06:25,230 --> 00:06:28,330
So we could say this is kind of an open source project

125
00:06:28,330 --> 00:06:31,963
anybody can see, therefore we'll go with the public option.

126
00:06:33,750 --> 00:06:36,900
And afterwards, we can initialize the repository

127
00:06:36,900 --> 00:06:39,610
with some other options to be selected.

128
00:06:39,610 --> 00:06:42,610
These are not related to the core concepts

129
00:06:42,610 --> 00:06:46,900
of Git and GitHub, therefore, we'll keep this boxes unticked

130
00:06:46,900 --> 00:06:48,910
and simply create a repository

131
00:06:48,910 --> 00:06:51,213
with this screen button here at the bottom.

132
00:06:52,830 --> 00:06:55,100
Now, this takes a few seconds.

133
00:06:55,100 --> 00:06:58,503
And with this, the repository was created.

134
00:07:00,080 --> 00:07:04,720
In here we now have multiple options on how to continue.

135
00:07:04,720 --> 00:07:08,210
One option right here would be to create a new file.

136
00:07:08,210 --> 00:07:10,230
At the moment, what we basically have

137
00:07:10,230 --> 00:07:12,540
is an empty project folder,

138
00:07:12,540 --> 00:07:15,410
so to say, not containing any data.

139
00:07:15,410 --> 00:07:18,990
Therefore, we could add data to this remote repository

140
00:07:18,990 --> 00:07:20,450
as one option.

141
00:07:20,450 --> 00:07:23,350
For us, as we have a local repository

142
00:07:23,350 --> 00:07:27,760
already on our machine, this is not what we want to do.

143
00:07:27,760 --> 00:07:32,070
Our next step would be to push an existing repository

144
00:07:32,070 --> 00:07:33,520
from the command line.

145
00:07:33,520 --> 00:07:34,770
Let me scroll down a bit.

146
00:07:35,720 --> 00:07:40,460
Now, pushing simply means bringing the repository content

147
00:07:40,460 --> 00:07:44,140
from the local environment, from the local repository,

148
00:07:44,140 --> 00:07:46,373
to the public one which has created.

149
00:07:48,240 --> 00:07:49,840
To be able to do this,

150
00:07:49,840 --> 00:07:53,420
we need to apply three different commands

151
00:07:53,420 --> 00:07:56,320
or, to be a bit more precise here, two commands,

152
00:07:56,320 --> 00:08:00,680
because this command here is just about renaming a branch.

153
00:08:00,680 --> 00:08:01,860
We don't have to do this.

154
00:08:01,860 --> 00:08:04,190
Our branch names are right already.

155
00:08:04,190 --> 00:08:07,270
Therefore, we only need to run this command here

156
00:08:07,270 --> 00:08:09,423
and this git push command.

157
00:08:10,350 --> 00:08:12,533
What are these commands about, though?

158
00:08:13,780 --> 00:08:18,210
Well, git remote here, this one, or git remote add,

159
00:08:18,210 --> 00:08:23,210
simply tells Git to add a connection to a remote repository,

160
00:08:24,000 --> 00:08:27,140
the remote repository, which has created.

161
00:08:27,140 --> 00:08:31,610
And to be sure that Git knows the location or the address

162
00:08:31,610 --> 00:08:35,120
of this repository, we need to add the URL.

163
00:08:35,120 --> 00:08:39,803
So right here, this is the URL of our remote repository.

164
00:08:40,940 --> 00:08:43,803
This URL can also be found up here, by the way.

165
00:08:45,220 --> 00:08:49,290
Ahead of the URL, we also have this origin keyword.

166
00:08:49,290 --> 00:08:52,930
Origin is a standard naming convention,

167
00:08:52,930 --> 00:08:55,020
so you could also name this differently.

168
00:08:55,020 --> 00:08:56,590
I don't recommend this, though.

169
00:08:56,590 --> 00:09:01,590
And origin is simply the shortcut of this URL.

170
00:09:01,630 --> 00:09:02,923
So, of this URL here.

171
00:09:03,820 --> 00:09:06,840
This means, by adding this remote connection

172
00:09:06,840 --> 00:09:08,470
with this command,

173
00:09:08,470 --> 00:09:12,490
Git knows that origin refers to this remote repository.

174
00:09:12,490 --> 00:09:15,500
And therefore, when running other commands,

175
00:09:15,500 --> 00:09:17,120
little hint down here,

176
00:09:17,120 --> 00:09:20,170
git push also contains this origin keyword,

177
00:09:20,170 --> 00:09:22,840
simply means that we only have to add origin

178
00:09:22,840 --> 00:09:25,890
and not the entire URL all the time.

179
00:09:25,890 --> 00:09:30,060
So that's basically this git remote add origin command.

180
00:09:30,060 --> 00:09:31,220
With this command,

181
00:09:31,220 --> 00:09:35,360
we can now simply copy the URL up here, by clicking there,

182
00:09:35,360 --> 00:09:38,833
and now we can go back to our local repository.

183
00:09:39,850 --> 00:09:43,590
So back in the project and what I want to do first,

184
00:09:43,590 --> 00:09:45,380
this is not required, by the way,

185
00:09:45,380 --> 00:09:48,350
I just want to make sure that we are all on the same page,

186
00:09:48,350 --> 00:09:51,410
is I want to go back to our main branch

187
00:09:51,410 --> 00:09:54,600
because, currently, at least in my case here,

188
00:09:54,600 --> 00:09:58,600
if I run git branch, you see that I am in the delete branch.

189
00:09:58,600 --> 00:10:01,160
And I don't want to have this branch in here

190
00:10:01,160 --> 00:10:02,860
in this remote project.

191
00:10:02,860 --> 00:10:06,303
Therefore, I'll switch back to the main branch,

192
00:10:09,057 --> 00:10:11,963
and now delete the delete branch to only have

193
00:10:11,963 --> 00:10:15,100
this main branch to get started with GitHub.

194
00:10:15,100 --> 00:10:18,050
So let's delete the delete branch by running

195
00:10:18,050 --> 00:10:22,710
git branch -D delete.

196
00:10:22,710 --> 00:10:25,740
With this, the branch has gone and now we only have

197
00:10:25,740 --> 00:10:28,763
the main branch left, and we are in this branch.

198
00:10:30,260 --> 00:10:34,540
Now what I'm going to do is I want to establish a connection

199
00:10:34,540 --> 00:10:38,500
between our remote and our local repository.

200
00:10:38,500 --> 00:10:39,810
This can be done by the command

201
00:10:39,810 --> 00:10:42,460
we just talked about on GitHub.

202
00:10:42,460 --> 00:10:46,040
So, git remote add.

203
00:10:46,040 --> 00:10:50,470
So add a remote connection to what?

204
00:10:50,470 --> 00:10:53,330
The origin remote repository.

205
00:10:53,330 --> 00:10:56,150
And what is the origin remote repository?

206
00:10:56,150 --> 00:10:58,200
Origin is just URL.

207
00:10:58,200 --> 00:11:00,990
We can now paste. It's the one we just copied.

208
00:11:00,990 --> 00:11:05,173
And by confirming this with enter, nothing happened.

209
00:11:06,140 --> 00:11:08,910
This is of course not true because now,

210
00:11:08,910 --> 00:11:12,820
our local repository is connected to the remote one.

211
00:11:12,820 --> 00:11:16,370
Now we only have to tell our local repository here

212
00:11:16,370 --> 00:11:18,590
that we want to bring this local code

213
00:11:18,590 --> 00:11:20,230
to the remote repository.

214
00:11:20,230 --> 00:11:22,770
And this can be done with another command.

215
00:11:22,770 --> 00:11:24,793
So let's go back to GitHub quickly.

216
00:11:26,550 --> 00:11:29,020
And this is the third command here,

217
00:11:29,020 --> 00:11:33,620
git push origin name, -U can be omitted.

218
00:11:33,620 --> 00:11:35,640
It's about so-called upstreams,

219
00:11:35,640 --> 00:11:38,313
which are not relevant for us at this stage.

220
00:11:39,380 --> 00:11:43,720
So git push simply means, bring the code from the local

221
00:11:43,720 --> 00:11:47,420
to the remote repository. And to which repository?

222
00:11:47,420 --> 00:11:50,120
Well, to the one with the origin name.

223
00:11:50,120 --> 00:11:52,860
So referring to this URL in a lower case.

224
00:11:52,860 --> 00:11:56,230
And they're into the main branch.

225
00:11:56,230 --> 00:11:58,803
So let's see if this works. So we go back.

226
00:11:59,940 --> 00:12:04,940
And I'll run, git push origin main.

227
00:12:06,690 --> 00:12:09,633
And by executing this command now,

228
00:12:11,380 --> 00:12:15,160
we get a warning, so to say, or a pop-up

229
00:12:15,160 --> 00:12:17,410
with the information that the extension

230
00:12:17,410 --> 00:12:21,120
GitHub wants to sign in, using GitHub.

231
00:12:21,120 --> 00:12:23,693
Well, what's going on right here now?

