1
00:00:01,040 --> 00:00:02,360
[Autogenerated] So next we're gonna walk

2
00:00:02,360 --> 00:00:04,630
through the process of adding a sub module

3
00:00:04,630 --> 00:00:07,550
to a project over the course of this demo

4
00:00:07,550 --> 00:00:08,750
here, specifically, what we're gonna

5
00:00:08,750 --> 00:00:11,540
cover, first of all, will be verifying our

6
00:00:11,540 --> 00:00:13,570
version of Get. We do need to be sure we

7
00:00:13,570 --> 00:00:15,540
have the correct version because gets a

8
00:00:15,540 --> 00:00:17,610
module support has changed slightly in

9
00:00:17,610 --> 00:00:19,950
certain releases. Then we'll be adding a

10
00:00:19,950 --> 00:00:23,030
sub model to a project. Then we'll be

11
00:00:23,030 --> 00:00:25,170
configuring. Get to better work with some

12
00:00:25,170 --> 00:00:27,190
modules as there are some small changes we

13
00:00:27,190 --> 00:00:28,960
can make that will help your interaction

14
00:00:28,960 --> 00:00:31,650
with get. Then we'll be updating a sub

15
00:00:31,650 --> 00:00:34,030
module and finally will be removing a sub

16
00:00:34,030 --> 00:00:38,010
module. So let's dive in. So as mentioned,

17
00:00:38,010 --> 00:00:39,460
we want to be sure that we verify the

18
00:00:39,460 --> 00:00:41,090
version of Get that we're leveraging now,

19
00:00:41,090 --> 00:00:43,160
here on my local machine I'm using get

20
00:00:43,160 --> 00:00:46,310
version 2.22. Now there are changes that

21
00:00:46,310 --> 00:00:48,080
have been made some significant changes to

22
00:00:48,080 --> 00:00:51,320
sub model support within get 1.751 point

23
00:00:51,320 --> 00:00:53,720
78 and even to 780.7. So we want to be

24
00:00:53,720 --> 00:00:55,230
sure that you're using at least version

25
00:00:55,230 --> 00:00:57,940
2.7 to be following along with this clip

26
00:00:57,940 --> 00:00:59,040
now, the next thing we're gonna do is

27
00:00:59,040 --> 00:01:00,450
we're going to make a repositories at we

28
00:01:00,450 --> 00:01:05,560
can leverage for this clip. Now, the next

29
00:01:05,560 --> 00:01:06,810
thing we're going to do is we're going to

30
00:01:06,810 --> 00:01:08,970
create a directory external, and this will

31
00:01:08,970 --> 00:01:11,090
be a directory where we will store the sub

32
00:01:11,090 --> 00:01:13,580
modules that we will add to this project.

33
00:01:13,580 --> 00:01:15,900
Next, we're going to actually run our get

34
00:01:15,900 --> 00:01:18,460
sub module, add command. And in this case,

35
00:01:18,460 --> 00:01:20,530
we're telling it to pull down the gate hub

36
00:01:20,530 --> 00:01:22,370
depository that I'm referencing. And we're

37
00:01:22,370 --> 00:01:23,820
telling it that it needs to store it in

38
00:01:23,820 --> 00:01:27,460
the external slash example Dash sub module

39
00:01:27,460 --> 00:01:30,140
directory. Now that we've added that in,

40
00:01:30,140 --> 00:01:33,840
we can now navigate to that directory.

41
00:01:33,840 --> 00:01:36,100
Once we do, we can see that it has pulled

42
00:01:36,100 --> 00:01:38,080
down the contents of that specific

43
00:01:38,080 --> 00:01:40,520
repositories. Well, now navigate back up

44
00:01:40,520 --> 00:01:43,040
to the parent repositories from here, we

45
00:01:43,040 --> 00:01:45,210
can now take a look at the get modules

46
00:01:45,210 --> 00:01:47,530
file that was included because we ran the

47
00:01:47,530 --> 00:01:50,910
get sub module, add command and we can see

48
00:01:50,910 --> 00:01:53,150
here that it does define a sub module

49
00:01:53,150 --> 00:01:55,030
within the directory external slash

50
00:01:55,030 --> 00:01:57,370
example dash sub module. Now it also

51
00:01:57,370 --> 00:01:59,500
includes the girl that I passed in that it

52
00:01:59,500 --> 00:02:02,140
is actually pulling the repositories from.

53
00:02:02,140 --> 00:02:06,140
And so next I'm going to run, get status.

54
00:02:06,140 --> 00:02:07,630
Now we can see here that there are two

55
00:02:07,630 --> 00:02:09,810
different files that are included. The

56
00:02:09,810 --> 00:02:11,810
first is get modules, which this is the

57
00:02:11,810 --> 00:02:13,640
file that we just looked at. The other is

58
00:02:13,640 --> 00:02:15,530
a reference to the specific commit of the

59
00:02:15,530 --> 00:02:18,070
repositories for our sub model. Now, this

60
00:02:18,070 --> 00:02:20,250
doesn't give us a ton of information about

61
00:02:20,250 --> 00:02:22,690
the sub module. So because of that, we can

62
00:02:22,690 --> 00:02:24,090
choose to set a different get

63
00:02:24,090 --> 00:02:26,040
configuration setting that will give us

64
00:02:26,040 --> 00:02:28,390
more information when we run, get status

65
00:02:28,390 --> 00:02:30,970
when we're leveraging some modules and

66
00:02:30,970 --> 00:02:32,960
this configuration setting is status dot

67
00:02:32,960 --> 00:02:34,870
sub module summary. So we'll set this

68
00:02:34,870 --> 00:02:37,000
value to true, and then we'll run. Get

69
00:02:37,000 --> 00:02:39,650
status again Now, Once we do this, we'll

70
00:02:39,650 --> 00:02:41,420
be able to see here that we do have some

71
00:02:41,420 --> 00:02:43,800
module changes that need to be committed.

72
00:02:43,800 --> 00:02:45,900
It even lets us know the specific commit

73
00:02:45,900 --> 00:02:47,750
that were actually referencing in what the

74
00:02:47,750 --> 00:02:49,670
commit message was for that specific

75
00:02:49,670 --> 00:02:52,450
commit. So next we'll go ahead and add

76
00:02:52,450 --> 00:02:57,070
both of these and then we'll commit, and

77
00:02:57,070 --> 00:02:58,690
that is a configuration that allows us to

78
00:02:58,690 --> 00:03:00,720
also get some module summaries when we're

79
00:03:00,720 --> 00:03:03,180
doing dips on our repositories. So we want

80
00:03:03,180 --> 00:03:06,640
to be sure that we set this value as well.

81
00:03:06,640 --> 00:03:09,440
So next I'm going to navigate outside of

82
00:03:09,440 --> 00:03:12,060
this specific repositories, and then I'm

83
00:03:12,060 --> 00:03:14,290
going to use the file protocol of get, and

84
00:03:14,290 --> 00:03:15,580
I'm actually going to clone the

85
00:03:15,580 --> 00:03:19,480
repositories that we just created. Next.

86
00:03:19,480 --> 00:03:21,220
I'm gonna change into the clone of our

87
00:03:21,220 --> 00:03:23,740
depository from here, will list the

88
00:03:23,740 --> 00:03:26,340
contents, and we can see that we do have

89
00:03:26,340 --> 00:03:28,620
the same files that we had previously. But

90
00:03:28,620 --> 00:03:30,890
next we will change into our external

91
00:03:30,890 --> 00:03:34,040
slash example Dash sub module directory.

92
00:03:34,040 --> 00:03:37,450
And when we do, we can see that there are

93
00:03:37,450 --> 00:03:40,480
no files currently within this directory.

94
00:03:40,480 --> 00:03:41,940
And this is because there are some

95
00:03:41,940 --> 00:03:43,440
additional steps that will need to

96
00:03:43,440 --> 00:03:45,500
perform. To be sure that we have fully

97
00:03:45,500 --> 00:03:47,890
initialized our sub module, we'll navigate

98
00:03:47,890 --> 00:03:49,740
back to the parent module and then from

99
00:03:49,740 --> 00:03:52,420
here we will first run, get some module in

100
00:03:52,420 --> 00:03:56,170
it, and next we'll actually update our sub

101
00:03:56,170 --> 00:03:59,180
module to pull down the code. Next will

102
00:03:59,180 --> 00:04:01,680
change back into our sub module directory,

103
00:04:01,680 --> 00:04:03,400
and we can now see that the files have

104
00:04:03,400 --> 00:04:05,840
populated from our sub module. So next

105
00:04:05,840 --> 00:04:07,160
we'll talk about how we update the

106
00:04:07,160 --> 00:04:09,360
reference for our sub module. So in this

107
00:04:09,360 --> 00:04:11,210
case at global Mantex, let's say that we

108
00:04:11,210 --> 00:04:13,790
want to leverage the specific beta branch

109
00:04:13,790 --> 00:04:15,740
off this shared repositories at we're

110
00:04:15,740 --> 00:04:18,060
pulling in as a sub module. In this case,

111
00:04:18,060 --> 00:04:21,180
we would first need to fetch after we

112
00:04:21,180 --> 00:04:23,710
fetch. Just like any normal repositories,

113
00:04:23,710 --> 00:04:25,660
we can check out a different branch. In

114
00:04:25,660 --> 00:04:26,890
this case, we'll check out the Beta

115
00:04:26,890 --> 00:04:29,780
branch. We will then change back into our

116
00:04:29,780 --> 00:04:33,040
parent directory and from here will run,

117
00:04:33,040 --> 00:04:36,780
get status. When we do, we can see that we

118
00:04:36,780 --> 00:04:41,700
do have new commits for our sub module. So

119
00:04:41,700 --> 00:04:44,270
next we will add and commit by updating

120
00:04:44,270 --> 00:04:46,050
this too. Now, leverage Debate. A branch

121
00:04:46,050 --> 00:04:47,620
of the same model that we pulled into our

122
00:04:47,620 --> 00:04:50,070
project now next will walk through the

123
00:04:50,070 --> 00:04:52,590
process of deleting the sub module from

124
00:04:52,590 --> 00:04:55,210
our project. The first step will be for us

125
00:04:55,210 --> 00:04:58,030
to DEA net the specific sub module. Now,

126
00:04:58,030 --> 00:05:00,030
at this point, we could choose to go back

127
00:05:00,030 --> 00:05:02,590
in and re innit that sub module so it's

128
00:05:02,590 --> 00:05:03,960
not removed permanently from our

129
00:05:03,960 --> 00:05:06,050
repositories. However next we will

130
00:05:06,050 --> 00:05:09,920
actually run. Get our M. Now. If we do

131
00:05:09,920 --> 00:05:13,320
this. We can now run, get status and part

132
00:05:13,320 --> 00:05:15,110
of what it's letting us know here is there

133
00:05:15,110 --> 00:05:17,760
is no longer a get depository at the

134
00:05:17,760 --> 00:05:19,610
location where it was previously. We've

135
00:05:19,610 --> 00:05:21,440
modified our get modules file, which has

136
00:05:21,440 --> 00:05:23,300
removed the module that we had previously

137
00:05:23,300 --> 00:05:25,290
included and it has deleted our sub

138
00:05:25,290 --> 00:05:28,120
module. Next from here will finalize this

139
00:05:28,120 --> 00:05:31,130
by committing toe are repositories. Now

140
00:05:31,130 --> 00:05:32,550
that we've done this, we've successfully

141
00:05:32,550 --> 00:05:35,250
shown how we can add update and then

142
00:05:35,250 --> 00:05:40,000
ultimately remove a sub module from a git repositories.

