1
00:00:06,820 --> 00:00:12,730
Hey what is up everybody this is Jason with Def soapstar calm and in this video we're going to cover

2
00:00:12,870 --> 00:00:14,770
the good basics.

3
00:00:14,770 --> 00:00:15,270
All right.

4
00:00:15,280 --> 00:00:17,130
So let's get to it.

5
00:00:17,140 --> 00:00:22,870
The first thing that I want you to do is go ahead and open up your terminal or your a command prompt

6
00:00:23,470 --> 00:00:29,170
and I'm going to zoom up on this so you can see what we're doing here and we're going to be working

7
00:00:29,170 --> 00:00:30,910
with here now.

8
00:00:30,960 --> 00:00:34,490
Max Apple products the Mac books and everything like that.

9
00:00:34,540 --> 00:00:38,610
They come with a Get already installed on the hardware.

10
00:00:38,620 --> 00:00:43,510
Now if you're a Windows user get may or may not come installed.

11
00:00:43,510 --> 00:00:48,180
So let me show you where to go to get get installed if you need to.

12
00:00:48,550 --> 00:00:51,180
Some opening up a browser here.

13
00:00:51,860 --> 00:00:53,670
Let me zoom up just a little bit.

14
00:00:54,040 --> 00:01:00,050
And what I'm going to do is I'm just going to do a simple Google search for and install it.

15
00:01:00,670 --> 00:01:01,240
All right.

16
00:01:01,240 --> 00:01:05,590
And then I don't know we can come down to the second one the first one might work.

17
00:01:05,590 --> 00:01:06,350
I don't know.

18
00:01:06,350 --> 00:01:11,100
Just come down to one of these and it says getting started installing get.

19
00:01:11,130 --> 00:01:13,490
All right so we can install from the source.

20
00:01:13,570 --> 00:01:18,020
And these are the combat the commands that you would throw in to your terminal here.

21
00:01:18,430 --> 00:01:24,250
And then down here shows you how to install this for Linux how to install it on Mac which again Mac

22
00:01:24,250 --> 00:01:26,060
already comes with it pre-installed.

23
00:01:26,350 --> 00:01:29,530
And then down here at the bottom it shows you how to install this for Windows.

24
00:01:29,560 --> 00:01:31,620
So this is a very very simple stuff.

25
00:01:31,630 --> 00:01:37,680
If you don't have get installed Do a google search install get get it installed.

26
00:01:37,700 --> 00:01:38,320
Pozza video.

27
00:01:38,320 --> 00:01:40,100
Come back I'm sure you're done.

28
00:01:40,360 --> 00:01:42,190
Let's get started.

29
00:01:42,190 --> 00:01:43,180
Cool.

30
00:01:43,180 --> 00:01:49,270
All right so what we're going to do here is we're on a we're we're in our terminal and what we want

31
00:01:49,270 --> 00:01:53,860
to do is create a project and we want to start tracking it with get it right.

32
00:01:53,920 --> 00:01:56,350
It is very useful it's very powerful.

33
00:01:56,380 --> 00:02:01,990
It's a version control for our projects and it allows us to track like time stamp different states of

34
00:02:01,990 --> 00:02:02,870
our project.

35
00:02:03,070 --> 00:02:08,800
So let's go ahead and change our directory onto the desktop and we're going to create a folder here

36
00:02:08,800 --> 00:02:09,820
so make Durr.

37
00:02:10,090 --> 00:02:13,210
And I'm going to call this good.

38
00:02:13,660 --> 00:02:16,260
Right and then dive into your folder here.

39
00:02:16,630 --> 00:02:21,330
And what we're going to do is we're going to create a file our first file on.

40
00:02:21,940 --> 00:02:29,500
So we can use touch and it's read me dot M-B which is a markdown file.

41
00:02:29,560 --> 00:02:30,030
OK.

42
00:02:30,130 --> 00:02:31,900
Go ahead and press enter.

43
00:02:31,900 --> 00:02:35,320
We list this out you can see that we've got a file in here.

44
00:02:35,590 --> 00:02:40,930
Now what we want to do is now that we've created this file Let's go ahead and just add some content

45
00:02:40,930 --> 00:02:44,680
to some text so we're going to use vim and we're going to do.

46
00:02:44,670 --> 00:02:46,860
Read me dot M.D.

47
00:02:47,290 --> 00:02:52,360
And this is going to take us into the read me file to take change to make changes.

48
00:02:52,420 --> 00:02:58,680
We're going to press I for insert and then let's just go and create a title my first title.

49
00:02:58,900 --> 00:03:07,510
I don't want something simple and go ahead and press X it shift colon lowercase X and there you have

50
00:03:07,510 --> 00:03:07,950
it.

51
00:03:07,990 --> 00:03:09,220
That's how you get out of them.

52
00:03:09,220 --> 00:03:10,680
I hate them.

53
00:03:10,780 --> 00:03:15,790
I used to have to do a forced quit of the terminal when I was in vim because I was stuck and I had no

54
00:03:15,790 --> 00:03:16,500
idea how to get out.

55
00:03:16,500 --> 00:03:17,990
It was worst.

56
00:03:18,340 --> 00:03:20,880
But anyways good thing this lesson is on get.

57
00:03:20,950 --> 00:03:27,670
All right so now if we do get status we just created a file and made a change in it.

58
00:03:27,670 --> 00:03:33,400
Now let's check with get status to see if there's been any changes that have happened in our project

59
00:03:34,110 --> 00:03:35,100
and this is fatal.

60
00:03:35,110 --> 00:03:37,150
Not a good repository.

61
00:03:37,180 --> 00:03:41,650
Now the reason it's throwing this error is because we have to initialize.

62
00:03:41,650 --> 00:03:43,390
Get on this folder.

63
00:03:43,390 --> 00:03:46,490
We have to tell get to start tracking this project.

64
00:03:46,720 --> 00:03:53,380
All right so to do that type get it right and you always want to make sure that you're at the root level

65
00:03:53,380 --> 00:04:00,790
of your project and what this means is any changes that happen in subdirectories or any files beneath

66
00:04:00,790 --> 00:04:07,540
this in the hierarchy of things it's going to track all of that good only tracks from the parent level

67
00:04:07,750 --> 00:04:08,760
and down.

68
00:04:09,010 --> 00:04:15,040
All right so we're going to do get a net awesome initialized empty good repository.

69
00:04:15,100 --> 00:04:16,640
So that's great news.

70
00:04:16,660 --> 00:04:23,230
So now it is tracking our project so if we did get status you can see that it says that we're on Branch

71
00:04:23,230 --> 00:04:24,230
master.

72
00:04:24,280 --> 00:04:30,220
It's our new initial commit and then you'll see that the read me file that we created down here is red.

73
00:04:30,390 --> 00:04:31,840
Well what does this mean.

74
00:04:31,840 --> 00:04:34,200
It means that this is an untracked file.

75
00:04:34,200 --> 00:04:37,360
We have never told get to track this file.

76
00:04:37,360 --> 00:04:37,760
All right.

77
00:04:37,780 --> 00:04:44,500
We initiated tracking on our folder but we haven't specifically told get to actually track anything

78
00:04:44,500 --> 00:04:45,310
in here.

79
00:04:45,310 --> 00:04:50,500
So let's go ahead and do this now just start tracking files we have to add it.

80
00:04:50,520 --> 00:04:54,840
All right we have to add it together and say hey we're adding this file to you.

81
00:04:54,970 --> 00:04:56,710
Go ahead and please track it.

82
00:04:56,770 --> 00:05:02,410
So we're going to do good add and then we can simply type out the name of our file.

83
00:05:02,410 --> 00:05:02,820
Cool.

84
00:05:02,830 --> 00:05:05,950
So we've added this to get it's now tracking it.

85
00:05:05,950 --> 00:05:13,960
So if we do get status now you can see that it has now been changed to N-Track.

86
00:05:13,990 --> 00:05:19,570
Now it's saying that it's being tracked here and that we have a new file that we've created called Read

87
00:05:19,570 --> 00:05:20,200
me.

88
00:05:20,220 --> 00:05:20,920
All right.

89
00:05:20,980 --> 00:05:23,460
So let's go ahead and make our first commit.

90
00:05:23,510 --> 00:05:25,210
It says changes to be committed.

91
00:05:25,240 --> 00:05:26,810
We've got it right here.

92
00:05:26,810 --> 00:05:35,270
All right so good commit dash em for message and then we'll our first message here first.

93
00:05:35,340 --> 00:05:39,190
In and hit enter.

94
00:05:39,190 --> 00:05:40,050
Perfect.

95
00:05:40,060 --> 00:05:43,030
So it says that we're on the master branch.

96
00:05:43,030 --> 00:05:46,130
It says that there's been one file change and one insertion.

97
00:05:46,230 --> 00:05:46,640
OK.

98
00:05:46,720 --> 00:05:49,530
Because we've now added this file to get to be tracked.

99
00:05:49,570 --> 00:05:51,030
So that's great.

100
00:05:51,040 --> 00:05:51,880
All right.

101
00:05:51,890 --> 00:06:02,070
Now let's go ahead and create a another change into our reading file here.

102
00:06:02,320 --> 00:06:08,100
And so we did vim dash read me again.

103
00:06:08,250 --> 00:06:11,140
Got to capitalize this if I want the auto correct to work.

104
00:06:11,140 --> 00:06:12,700
And we're going to come inside here.

105
00:06:12,730 --> 00:06:18,590
We're going to hit Eifert insert and then come to the end and we're going to make another change.

106
00:06:18,880 --> 00:06:20,950
And let's just make another title here.

107
00:06:21,330 --> 00:06:22,050
OK.

108
00:06:22,510 --> 00:06:24,090
Second title.

109
00:06:24,220 --> 00:06:24,900
Awesome.

110
00:06:25,150 --> 00:06:29,680
Go ahead and press X shift Colan X are right.

111
00:06:29,680 --> 00:06:35,250
So now if we did a guest status you can see that the file has been modified now.

112
00:06:35,380 --> 00:06:41,050
So before it was telling us that we had an untracked file and it says Dude you've created a new file

113
00:06:41,050 --> 00:06:41,870
here.

114
00:06:41,900 --> 00:06:42,450
All right.

115
00:06:42,550 --> 00:06:47,290
Well now we've actually modified that file and good is going to tell us that.

116
00:06:47,470 --> 00:06:53,480
So when we have projects and if we are creating new files or modify the existing files when we do get

117
00:06:53,500 --> 00:06:59,110
status to see kind of what's been happening in our project what we've been working on good is going

118
00:06:59,110 --> 00:07:03,760
to spit out everything that we've been doing and whether we've modified files or created new files.

119
00:07:03,790 --> 00:07:04,490
All right.

120
00:07:04,780 --> 00:07:12,180
And so now that we've done the status now we can go ahead and add this again so we want to say Get had

121
00:07:13,050 --> 00:07:19,220
the read me file and now we can go ahead and I'm just going to get status here.

122
00:07:19,600 --> 00:07:22,570
So now it's saying that it's been modified.

123
00:07:22,590 --> 00:07:23,400
Right.

124
00:07:24,010 --> 00:07:26,410
And we've added it.

125
00:07:26,420 --> 00:07:27,790
So now it's being tracked again.

126
00:07:27,790 --> 00:07:39,300
So get it dash em so we can add a message and then added a second title cool.

127
00:07:39,450 --> 00:07:46,750
So one file change and two insertions and it says two insertions because we created a blank line in

128
00:07:46,750 --> 00:07:50,750
our Rimi file and then underneath that we created the title the title.

129
00:07:50,770 --> 00:07:52,500
So cool stuff to know.

130
00:07:52,570 --> 00:08:02,080
Now the next thing I want to move onto is tracking different versions of every get commit that we've

131
00:08:02,080 --> 00:08:02,720
done.

132
00:08:02,740 --> 00:08:05,330
So for example we've made two committees.

133
00:08:05,470 --> 00:08:09,480
So if we do a good command we're sorry I get log.

134
00:08:10,300 --> 00:08:14,370
You can see that we've made two commits here it time stamps it for us.

135
00:08:14,370 --> 00:08:18,860
The thing is set in stone it's going to be added to world history.

136
00:08:18,880 --> 00:08:21,410
This is never going to go away and we will never lose it.

137
00:08:21,580 --> 00:08:26,830
Now I want to show you something really important here say that your your boss comes to you and he's

138
00:08:26,830 --> 00:08:31,320
like dude like I don't know why you created that second file or maybe that you've got a project with

139
00:08:31,330 --> 00:08:36,420
like a thousand lines of code and you change something and he's like bro you've messed everything up

140
00:08:36,430 --> 00:08:40,490
like this is terrible we need to go back to the previous version.

141
00:08:40,690 --> 00:08:41,910
Well how do we do that.

142
00:08:41,920 --> 00:08:46,290
How do we go back to the version before we added that second title.

143
00:08:46,330 --> 00:08:54,880
So if we wanted to go to the first version and this is right it right here you can see where is it.

144
00:08:54,970 --> 00:08:59,590
So here it says we added the second title right here was our first commit.

145
00:08:59,590 --> 00:09:00,150
All right.

146
00:09:00,250 --> 00:09:04,840
So does it chronologically does it from the most recent on top to the oldest on the bottom.

147
00:09:04,870 --> 00:09:13,510
So what we can do is do a good check out and we actually just need the first seven characters of the

148
00:09:13,510 --> 00:09:15,220
commit that we're checking out.

149
00:09:15,220 --> 00:09:24,950
So one two three four five six seven and then go ahead and copy them at a space and we'll paste that.

150
00:09:25,330 --> 00:09:33,970
So if I hit Enter now it says get check out the new branch here it says you are in a detached head state.

151
00:09:34,090 --> 00:09:38,800
You can look around make experimental changes and commit them and you can discard any commits if you

152
00:09:38,800 --> 00:09:43,670
make this state without impacting any branches by performing another check out.

153
00:09:43,840 --> 00:09:45,510
Well what does this mean.

154
00:09:45,790 --> 00:09:47,820
If we do a get branch.

155
00:09:48,240 --> 00:09:48,870
All right.

156
00:09:48,960 --> 00:09:51,690
That says that we're at a detached head.

157
00:09:51,760 --> 00:10:00,460
So what I really want to do is create a new branch for everything that I've been working on and will

158
00:10:00,460 --> 00:10:01,880
simply do this by good.

159
00:10:01,960 --> 00:10:04,750
Check out dash B.

160
00:10:04,870 --> 00:10:09,880
And then we'll name the branch I'm just going to call this my branch and what it's going to do is it's

161
00:10:09,880 --> 00:10:12,130
going to take all the changes that we've been making.

162
00:10:12,340 --> 00:10:19,000
Because right now it's hard to detect a detached head of master but we just want to pull this into our

163
00:10:19,000 --> 00:10:23,110
own branch so all the changes that we've been making we're now going to check out and create our new

164
00:10:23,110 --> 00:10:25,260
branch and put those changes into it.

165
00:10:25,540 --> 00:10:31,310
All right so cool it says switch to a new branch which is the branch I created called my branch.

166
00:10:31,330 --> 00:10:37,980
Now remember we just checked out a previous commit here.

167
00:10:38,260 --> 00:10:44,980
So to see the previous commit that we made let's simply do the VM again and let's go ahead and check

168
00:10:44,980 --> 00:10:47,330
out the read me and see what's in there.

169
00:10:47,890 --> 00:10:49,300
So check that out.

170
00:10:49,300 --> 00:10:51,160
It says it's my first title.

171
00:10:51,160 --> 00:10:53,680
There's only one title in here right.

172
00:10:53,710 --> 00:10:55,970
Go ahead and exit out of this.

173
00:10:56,440 --> 00:11:00,310
And I'm just going to hit shift Colan x.

174
00:11:00,340 --> 00:11:01,620
We're out of it.

175
00:11:01,750 --> 00:11:08,400
Let's do the get log again and then let's go to the second commit that we did.

176
00:11:08,740 --> 00:11:11,360
Oh actually we were in a detached head.

177
00:11:11,530 --> 00:11:13,790
So it only has this initial stuff.

178
00:11:13,840 --> 00:11:15,400
So check this out.

179
00:11:15,400 --> 00:11:18,990
Let's do a let's create a file.

180
00:11:19,210 --> 00:11:22,530
Touch main dot J us k.

181
00:11:22,540 --> 00:11:26,440
Now if we do our guest status remember we have an untracked file.

182
00:11:26,470 --> 00:11:28,900
We've never told get to track this before.

183
00:11:28,900 --> 00:11:31,630
So why don't we go ahead and tell it to track it.

184
00:11:31,810 --> 00:11:39,930
So get at Main dot J us OK we'll do another get status see what's happening here.

185
00:11:39,940 --> 00:11:44,950
So now it's being tracked and says hey you've actually got this new file that's never been tracked before.

186
00:11:44,950 --> 00:11:48,190
So what's committed the cash am

187
00:11:52,100 --> 00:11:55,950
don't want caps on added file.

188
00:11:56,480 --> 00:12:00,980
And then we go in there one file changes your insertions 0 deletions.

189
00:12:01,010 --> 00:12:01,670
Cool.

190
00:12:01,970 --> 00:12:04,030
So just status.

191
00:12:04,190 --> 00:12:07,730
And it says nothing to commit the working tree is clean.

192
00:12:07,730 --> 00:12:09,280
So this is great news.

193
00:12:09,290 --> 00:12:15,090
So what I'm going to do here is say that your boss comes to you and says bro you've created this.

194
00:12:15,220 --> 00:12:16,760
This javascript file.

195
00:12:16,760 --> 00:12:17,960
It doesn't make any sense.

196
00:12:17,960 --> 00:12:18,740
We don't need it.

197
00:12:18,740 --> 00:12:20,730
You wasted a ton of time.

198
00:12:20,870 --> 00:12:22,920
It's broken the current code.

199
00:12:23,000 --> 00:12:26,170
Please we need to go back to the previous version.

200
00:12:26,170 --> 00:12:26,570
All right.

201
00:12:26,570 --> 00:12:32,640
So again let's do that get log and you can see that we have two.

202
00:12:33,200 --> 00:12:38,690
Two commits that we've done here on this branch that we created and we have our first commit and then

203
00:12:38,690 --> 00:12:41,000
we just added this javascript file.

204
00:12:41,000 --> 00:12:42,890
So this added file commit here.

205
00:12:42,890 --> 00:12:47,020
This one here that we just did is the one that broke our project.

206
00:12:47,150 --> 00:12:51,400
We need to go back to the previous version where we didn't have this file.

207
00:12:51,410 --> 00:12:58,680
So again all we need to do is do I get a check out and then the first 7 characters of our commit 1 2

208
00:12:58,700 --> 00:13:06,230
3 4 5 6 7 go ahead and copy that and then we'll go ahead and paste this.

209
00:13:06,260 --> 00:13:10,430
Now it says the head is now at your first commit.

210
00:13:10,460 --> 00:13:11,330
All right.

211
00:13:11,330 --> 00:13:12,690
So check this out.

212
00:13:12,710 --> 00:13:16,720
We're in our project we had a read me file and a javascript file.

213
00:13:16,730 --> 00:13:22,950
All right I can actually pull this open for us so we can kind of see what's going on here.

214
00:13:23,060 --> 00:13:29,160
So let's check this out so you can see that we've only got the reading file in here.

215
00:13:29,240 --> 00:13:37,160
If I list this out we've only got the read me file but if I go ahead and I do the get log again and

216
00:13:37,160 --> 00:13:38,960
say we want the.

217
00:13:39,510 --> 00:13:43,990
Where's that other one with the file that we had at Cisco right here.

218
00:13:44,300 --> 00:13:49,400
The added file 1 2 3 4 5 6 7.

219
00:13:49,490 --> 00:13:52,210
So we want to check out this commit now.

220
00:13:52,820 --> 00:13:59,870
Let's go ahead and I have to do the get checked out get check out this branch.

221
00:14:00,020 --> 00:14:02,300
So now it says the head is now at the added File.

222
00:14:02,300 --> 00:14:03,400
We'll check that out.

223
00:14:03,440 --> 00:14:05,310
There is our main yes.

224
00:14:05,510 --> 00:14:08,000
So very important stuff we've covered today.

225
00:14:08,180 --> 00:14:14,750
We have learned how to initialize get We've learned how to add files to get and to track those.

226
00:14:14,750 --> 00:14:16,790
And then also how to do.

227
00:14:16,880 --> 00:14:19,620
Out and things like that for different branches.

228
00:14:19,640 --> 00:14:27,620
Now the last thing that I want to cover is how to add multiple files to your commit right before we've

229
00:14:27,620 --> 00:14:30,270
been adding individual files at a time.

230
00:14:30,680 --> 00:14:36,010
Heck what if we like added 10 files and changed a ton of things and other files.

231
00:14:36,080 --> 00:14:45,390
So now that we've got this version checked out here with the added file Let's do this let's do touch.

232
00:14:47,120 --> 00:14:52,230
We'll do an awesome dodgier as we'll do an index dot aged him.

233
00:14:52,310 --> 00:15:00,770
And we'll do a style that CSSA will add some files here and then lets them into the read me and then

234
00:15:00,770 --> 00:15:13,200
we're going to add an insertion here and we'll say so many important files added.

235
00:15:13,280 --> 00:15:16,870
Obviously this wouldn't be added to a read me.

236
00:15:17,270 --> 00:15:18,690
I will just use this for now.

237
00:15:18,710 --> 00:15:22,130
So hit X shift colon x.

238
00:15:22,370 --> 00:15:22,750
Perfect.

239
00:15:22,750 --> 00:15:23,630
So now we're out of that.

240
00:15:23,630 --> 00:15:24,770
So check this out.

241
00:15:24,770 --> 00:15:30,830
If we do get status on this we can see that we've modified the read me file and that we've got all these

242
00:15:30,830 --> 00:15:32,100
untracked files here.

243
00:15:32,340 --> 00:15:37,640
Well instead of doing the add in every single file why don't we just add everything as a group.

244
00:15:37,640 --> 00:15:45,080
Say I want to add anything that's new and anything that's modified to be tracked with it so we can do

245
00:15:45,080 --> 00:15:48,980
that get ADD or add dash capital A.

246
00:15:49,130 --> 00:15:50,830
And this is this is more traditional.

247
00:15:50,830 --> 00:15:54,980
This is what you're going to see and you're just going to grab everything and then add it.

248
00:15:54,980 --> 00:16:02,840
Now do be warned that you maybe you were working on a feature or maybe in a folder that you don't want

249
00:16:02,840 --> 00:16:11,090
to be tracked yet with yet because it's kind of experimental you want to you'd like to get at or a different

250
00:16:11,090 --> 00:16:16,180
method not to get capital A to grab everything because you'd want to exclude that folder.

251
00:16:16,460 --> 00:16:18,770
So you add dash.

252
00:16:19,190 --> 00:16:24,770
And then we can do a get status here and now you can see that these are now being tracked.

253
00:16:24,770 --> 00:16:27,780
We've got a modified and three new files.

254
00:16:27,820 --> 00:16:32,890
All right and then we can go ahead and commit this good commit Dasch am.

255
00:16:33,350 --> 00:16:37,680
So much awesomeness.

256
00:16:37,880 --> 00:16:39,260
K cool.

257
00:16:39,260 --> 00:16:41,900
So it says for files change two insertions.

258
00:16:41,900 --> 00:16:45,110
So it's grabbed all those and it's it's committed it for us.

259
00:16:45,170 --> 00:16:48,740
Now we haven't covered about pushing this stuff yet.

260
00:16:48,740 --> 00:16:50,700
We're going to cover that in some later lessons.

261
00:16:50,880 --> 00:16:53,320
But it I know this has a lot to take in.

262
00:16:53,330 --> 00:16:59,120
We watched the video a couple of times if you need to get can be very confusing in the beginning.

263
00:16:59,120 --> 00:17:03,530
But rewash this video if you need brush up on it kind of experiment creating some of your own files

264
00:17:03,530 --> 00:17:07,820
and tracking them and things like that so that's a wrap for this lesson.

265
00:17:07,820 --> 00:17:08,530
Let's move on.
