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