1
00:00:01,040 --> 00:00:01,990
[Autogenerated] So now that we've talked

2
00:00:01,990 --> 00:00:04,180
about get configuration and how we can use

3
00:00:04,180 --> 00:00:06,570
it to change how get functions, we're now

4
00:00:06,570 --> 00:00:08,450
gonna talk about a different aspect of

5
00:00:08,450 --> 00:00:10,310
configuration, which enables us to

6
00:00:10,310 --> 00:00:12,160
configure how get deals with specific

7
00:00:12,160 --> 00:00:14,760
files and that's called get attributes.

8
00:00:14,760 --> 00:00:16,190
Now there's two different ways that get

9
00:00:16,190 --> 00:00:17,880
really can handle dealing with files

10
00:00:17,880 --> 00:00:20,410
differently. The first is get ignore, and

11
00:00:20,410 --> 00:00:22,200
this is what allows us to determine files

12
00:00:22,200 --> 00:00:24,200
in which get will simply ignore and not

13
00:00:24,200 --> 00:00:26,110
include within the repositories. But then

14
00:00:26,110 --> 00:00:27,890
we also have get attributes, and this

15
00:00:27,890 --> 00:00:29,940
allows us to set specific configuration

16
00:00:29,940 --> 00:00:32,290
values for how specific files or groups of

17
00:00:32,290 --> 00:00:35,180
files are handled. So at a high level, get

18
00:00:35,180 --> 00:00:37,170
attributes are placed on a file or a

19
00:00:37,170 --> 00:00:39,070
collection of files within a depository,

20
00:00:39,070 --> 00:00:41,580
and it dictates how this file is handled.

21
00:00:41,580 --> 00:00:43,580
Now, in some cases, different get hosts

22
00:00:43,580 --> 00:00:45,910
may offer specific functionality that

23
00:00:45,910 --> 00:00:48,060
leverages these attributes. So let's talk

24
00:00:48,060 --> 00:00:49,810
about some common use cases. Forget

25
00:00:49,810 --> 00:00:52,170
attributes. First of all, you can

26
00:00:52,170 --> 00:00:55,190
configure line endings in files with get

27
00:00:55,190 --> 00:00:57,780
attributes. You also can specify files

28
00:00:57,780 --> 00:01:00,570
that are binary versus files that are not.

29
00:01:00,570 --> 00:01:02,740
You also can enable large binary foul

30
00:01:02,740 --> 00:01:05,820
support with get L F s. You also can

31
00:01:05,820 --> 00:01:07,970
exclude files from the exported version of

32
00:01:07,970 --> 00:01:10,670
a repositories, and you can specify clean

33
00:01:10,670 --> 00:01:12,330
and smudge filters, which will talk more

34
00:01:12,330 --> 00:01:14,510
about in just a minute. So let's look at a

35
00:01:14,510 --> 00:01:17,440
sample, get attributes file. So here is an

36
00:01:17,440 --> 00:01:19,740
example file from within a repositories

37
00:01:19,740 --> 00:01:22,200
and you can see first we're setting it to

38
00:01:22,200 --> 00:01:24,850
auto detect the line endings for specific

39
00:01:24,850 --> 00:01:27,230
files. You can also see here that we are

40
00:01:27,230 --> 00:01:29,740
setting the specific file. Such a JPEG

41
00:01:29,740 --> 00:01:31,570
files and P and she files are binary

42
00:01:31,570 --> 00:01:34,340
files. Now, as a note, in most cases, you

43
00:01:34,340 --> 00:01:36,570
don't have to specify this yourself. Get

44
00:01:36,570 --> 00:01:38,960
does a great job detecting and determining

45
00:01:38,960 --> 00:01:41,640
what is binary. However, if you ever run

46
00:01:41,640 --> 00:01:43,600
into a situation where it is not handling

47
00:01:43,600 --> 00:01:45,980
it properly, you can choose to set that

48
00:01:45,980 --> 00:01:48,050
specifically within the get attributes

49
00:01:48,050 --> 00:01:50,710
file. You can also see an example here of

50
00:01:50,710 --> 00:01:52,970
using get LF s for storing zip files with

51
00:01:52,970 --> 00:01:54,910
inner repositories and this again is

52
00:01:54,910 --> 00:01:57,680
dependent on your host support. Forget LF

53
00:01:57,680 --> 00:01:59,930
s and we also have an example here where

54
00:01:59,930 --> 00:02:02,700
we're using the export ignore a tribute to

55
00:02:02,700 --> 00:02:04,860
set that value for our test directory. So

56
00:02:04,860 --> 00:02:07,110
it is not included within the exported

57
00:02:07,110 --> 00:02:09,320
version of the repositories. But let's

58
00:02:09,320 --> 00:02:10,910
talk next about a more complicated

59
00:02:10,910 --> 00:02:13,190
example, utilizing something called Get

60
00:02:13,190 --> 00:02:15,770
clean and smudge filters. So, first of

61
00:02:15,770 --> 00:02:17,860
all, within any project, you're going to

62
00:02:17,860 --> 00:02:19,370
have a staging process. When you have

63
00:02:19,370 --> 00:02:21,230
files that are ready to be committed,

64
00:02:21,230 --> 00:02:22,340
you're going to have your working

65
00:02:22,340 --> 00:02:23,780
directory, which are the files that you're

66
00:02:23,780 --> 00:02:25,400
choosing to work with, and then you're

67
00:02:25,400 --> 00:02:27,180
gonna have this staging area. So once

68
00:02:27,180 --> 00:02:28,850
things are ready to push into the

69
00:02:28,850 --> 00:02:31,410
repositories, now, we can choose to define

70
00:02:31,410 --> 00:02:33,090
inside of our get attributes, file a

71
00:02:33,090 --> 00:02:35,330
filter and in this case, were choosing to

72
00:02:35,330 --> 00:02:37,530
specify a filter just on the Java script

73
00:02:37,530 --> 00:02:39,800
files within our repositories. And there

74
00:02:39,800 --> 00:02:42,030
are two functions for this filter. One is

75
00:02:42,030 --> 00:02:44,640
smudge and one is clean. So let's say, for

76
00:02:44,640 --> 00:02:46,960
example, we have an A P I ke that is

77
00:02:46,960 --> 00:02:48,680
present within our job. A script files,

78
00:02:48,680 --> 00:02:50,520
and we want to remove that so it's not

79
00:02:50,520 --> 00:02:53,070
stored in our repositories. We can choose

80
00:02:53,070 --> 00:02:54,910
in this case to use the clean and smudge

81
00:02:54,910 --> 00:02:57,050
filter to make that happen. So let's look

82
00:02:57,050 --> 00:02:58,850
at what would happen to these files first

83
00:02:58,850 --> 00:03:01,010
of all, because this is a JavaScript

84
00:03:01,010 --> 00:03:03,300
filter are read Me file would be passed

85
00:03:03,300 --> 00:03:05,140
through without going through the filter.

86
00:03:05,140 --> 00:03:07,210
However, our job script files would pass

87
00:03:07,210 --> 00:03:09,880
into the clean filter, and this function

88
00:03:09,880 --> 00:03:12,530
would remove references to our specific AP

89
00:03:12,530 --> 00:03:14,650
____, and then we would see it go from the

90
00:03:14,650 --> 00:03:17,420
clean into the staging area. However, this

91
00:03:17,420 --> 00:03:19,590
is just the staging process. We would need

92
00:03:19,590 --> 00:03:21,350
to have the reverse of this happened in

93
00:03:21,350 --> 00:03:23,510
the checkout process, and that's what this

94
00:03:23,510 --> 00:03:25,490
much filter will do. So first, within our

95
00:03:25,490 --> 00:03:27,680
checkout process, we would see the Read me

96
00:03:27,680 --> 00:03:29,580
file continue to pass through, just as it

97
00:03:29,580 --> 00:03:31,770
did before. So next we would see are

98
00:03:31,770 --> 00:03:33,530
JavaScript files moved through the smudge

99
00:03:33,530 --> 00:03:35,680
filter, and this would take the default

100
00:03:35,680 --> 00:03:37,610
placeholder that we put in place and then

101
00:03:37,610 --> 00:03:40,770
replace it with the specific AP I ke. And

102
00:03:40,770 --> 00:03:42,180
we would then see the proper values

103
00:03:42,180 --> 00:03:44,600
reflected within our working directory.

104
00:03:44,600 --> 00:03:46,340
And this is just another example of what

105
00:03:46,340 --> 00:03:48,500
can be accomplished by utilizing get

106
00:03:48,500 --> 00:03:50,790
attributes. So next we're gonna walk

107
00:03:50,790 --> 00:03:52,540
through the process of implementing

108
00:03:52,540 --> 00:03:54,530
specific get attributes within a git

109
00:03:54,530 --> 00:03:56,660
repositories, and using a clean it's much

110
00:03:56,660 --> 00:04:00,000
filter is one of the attributes that will include

