1
00:00:07,470 --> 00:00:13,900
Yo what is up everybody this is Jason what does soapstar calm and in this video we're going to learn

2
00:00:13,900 --> 00:00:21,100
how to work with local and remote servers we're going to learn how to take our projects and push them

3
00:00:21,160 --> 00:00:24,490
up to get hubs so we can start tracking this version control.

4
00:00:24,490 --> 00:00:28,540
All right we've already learned how to track files.

5
00:00:28,540 --> 00:00:34,420
Now it's important and it's time to get them pushed some what we're going to do is I want you to open

6
00:00:34,420 --> 00:00:38,560
up your browser and I want you to be in your hub account.

7
00:00:38,590 --> 00:00:39,210
All right.

8
00:00:39,400 --> 00:00:43,830
And what we're going to do is we're going to create a new repository.

9
00:00:44,050 --> 00:00:51,990
So kind of on the home page of your account you can see here is a new repository here and on the dropdown

10
00:00:52,000 --> 00:00:55,630
There's also a new repository and you can find it in other places.

11
00:00:55,630 --> 00:01:00,880
Now for this video Zane repository I'm going to be using the word Ribault because it's a lot easier

12
00:01:00,880 --> 00:01:03,390
to say and it's a little bit more common to say.

13
00:01:03,610 --> 00:01:07,680
So go ahead and click on new repositories.

14
00:01:08,080 --> 00:01:08,380
All right.

15
00:01:08,380 --> 00:01:19,900
So here we we are going to give our repository a name and in this case let's just call this my first

16
00:01:19,900 --> 00:01:20,670
Ribault.

17
00:01:20,900 --> 00:01:21,400
OK.

18
00:01:21,740 --> 00:01:22,710
All right.

19
00:01:22,720 --> 00:01:24,430
And then we can give it a.

20
00:01:24,640 --> 00:01:27,050
We won't worry about a description doesn't matter.

21
00:01:27,190 --> 00:01:32,930
And then down here we can either create this Ribault to be public or private.

22
00:01:33,010 --> 00:01:39,820
Now with public repo's are free if you want to create private repo's if you're working with a business

23
00:01:39,820 --> 00:01:45,080
or you're a freelancer and you keep the project private you can sign up for one of get hubs plans.

24
00:01:45,260 --> 00:01:45,770
All right.

25
00:01:45,790 --> 00:01:52,900
And then coming down here you can initialize a Rigney file which you should really always have for each

26
00:01:52,900 --> 00:01:58,060
one of your projects giving in our reviewer a description of what it is and how it works.

27
00:01:58,270 --> 00:02:04,330
And then at the very bottom here and you can see that you can add a good ignore file and this is really

28
00:02:04,330 --> 00:02:04,920
really cool.

29
00:02:04,960 --> 00:02:06,060
So what a.

30
00:02:06,250 --> 00:02:13,550
Ignore does is it tells get to not track specific files so why would we want to do this.

31
00:02:13,660 --> 00:02:19,630
Well for example if we're working on a project and we're using a third party library of some sort.

32
00:02:19,630 --> 00:02:28,000
Like firebase for an example and you have a unique app ID that it generates for you.

33
00:02:28,330 --> 00:02:30,000
You're going to want to keep that private.

34
00:02:30,010 --> 00:02:32,380
You're not going to want to push that to a public repo.

35
00:02:32,380 --> 00:02:36,180
Otherwise everybody can get into your account it could really mess things up.

36
00:02:36,250 --> 00:02:42,040
But if you're using this app ID from firebase for example in your project and it's referencing it for

37
00:02:42,040 --> 00:02:49,780
local testing then you would probably want to do a get ignore on a file like that so just you know you

38
00:02:49,780 --> 00:02:54,700
can ignore certain files in your project that you don't want to be tracked.

39
00:02:54,700 --> 00:02:56,230
So we've gone ahead.

40
00:02:56,240 --> 00:02:58,600
We've given our people a name.

41
00:02:58,600 --> 00:03:00,370
Let's go ahead and create it.

42
00:03:00,370 --> 00:03:04,940
So I'm going to create a repository and then down here check this out.

43
00:03:04,990 --> 00:03:13,140
So we've got a couple of ways that we can set this project up on our local machine here.

44
00:03:13,210 --> 00:03:19,150
We can either do that through an h t t p s or S-sh and we're going to do this through S-sh since we've

45
00:03:19,150 --> 00:03:23,230
already set up a key and it makes that little bit more secure for us.

46
00:03:23,440 --> 00:03:29,140
And because we didn't create a Rimi file it actually is really cool.

47
00:03:29,140 --> 00:03:35,410
It gives us the commands that we can throw in our terminal that we can do to set this up and you can

48
00:03:35,410 --> 00:03:38,310
actually literally just copy and paste this.

49
00:03:38,980 --> 00:03:40,850
Let me open up my terminal here.

50
00:03:41,260 --> 00:03:48,700
If we wanted to we could literally just copy and paste it in it add the read me file make the first

51
00:03:48,700 --> 00:03:55,590
commit and then add the repository so it can start tracking here.

52
00:03:55,750 --> 00:03:58,210
And we're going to do this a different way.

53
00:03:58,240 --> 00:03:59,860
It's going to be the more common way.

54
00:04:00,190 --> 00:04:07,510
And now that we have this repository created we want to go ahead in what's called clone it to our local

55
00:04:07,510 --> 00:04:08,650
machine here.

56
00:04:08,670 --> 00:04:13,420
All right which is basically downloading and copying it on our local machine here.

57
00:04:13,420 --> 00:04:16,780
All right so we've got this all set up here.

58
00:04:16,960 --> 00:04:22,780
So what I'm going to do is we're going to use our S-sh method of cloning this and this is going to work

59
00:04:22,780 --> 00:04:26,000
for us because we've got ahead and we set up an S-sh key already.

60
00:04:26,050 --> 00:04:35,350
So go ahead and hit copy to clipboard and then inside of our terminal here we're going to go ahead and

61
00:04:35,350 --> 00:04:41,090
just navigate to your desktop and we're going to go ahead and throw the project on here so we're going

62
00:04:41,130 --> 00:04:41,930
right in.

63
00:04:42,100 --> 00:04:51,220
Get clone and then go ahead and paste in the URL that get hub provided to you and hit and hit enter.

64
00:04:51,220 --> 00:04:57,550
And you can see it says it's cloning into my first repo which is great and because we've set up our

65
00:04:57,550 --> 00:05:03,460
S-sh key go ahead and enter the password for them perfect.

66
00:05:03,470 --> 00:05:07,790
All right so let's go ahead and make sure this has cloned successfully.

67
00:05:08,000 --> 00:05:09,070
And I've got it right here.

68
00:05:09,080 --> 00:05:10,370
My first repot.

69
00:05:10,570 --> 00:05:14,200
And if we open this up the folder is empty.

70
00:05:14,240 --> 00:05:19,640
So coming back into our terminal Let's go ahead and create a few files here.

71
00:05:19,970 --> 00:05:25,300
So I'm going to do first I need to get into my project.

72
00:05:25,730 --> 00:05:34,700
So my first Ribault OK change the directory there and we'll create an HD mail file and a javascript

73
00:05:34,700 --> 00:05:36,460
file call.

74
00:05:36,680 --> 00:05:44,270
So if we list that out we've got those two files there and then I'm going to poll where is my Finder

75
00:05:44,270 --> 00:05:46,680
window it's hiding from me.

76
00:05:47,240 --> 00:05:48,080
Here it is.

77
00:05:48,080 --> 00:05:48,400
All right.

78
00:05:48,400 --> 00:05:54,140
So we found it and we're on the desktop here and we just created this file here.

79
00:05:54,440 --> 00:05:57,070
So I'm going to make this a little bit smaller.

80
00:05:57,080 --> 00:06:01,470
We'll bring up the terminal up here.

81
00:06:01,610 --> 00:06:04,090
Sorry for all the you one peanuts.

82
00:06:04,130 --> 00:06:04,390
All right.

83
00:06:04,390 --> 00:06:08,700
So we've created our first two files here now.

84
00:06:09,110 --> 00:06:11,480
Now we have created our repo.

85
00:06:11,480 --> 00:06:15,370
We haven't pushed anything from it and we're also not tracking anything yet.

86
00:06:15,590 --> 00:06:24,310
So if we do get status it says that we have some untracked files here so we can go ahead and use the

87
00:06:24,310 --> 00:06:32,420
get and dash AA because that's going to grab everything inside of this directory here and we're going

88
00:06:32,420 --> 00:06:42,320
to go ahead and add it and then we'll do it here and we're going to type in the message will be added

89
00:06:42,320 --> 00:06:52,130
files can and then if we do a get status again it says nothing to commit working tree is clean.

90
00:06:52,400 --> 00:06:58,220
And if you notice this time around when we created this project and cloned it and we didn't have to

91
00:06:58,220 --> 00:06:59,550
do it it.

92
00:06:59,660 --> 00:07:07,220
And the reason is because we we already set up this repository up and get HUD which also includes like

93
00:07:07,250 --> 00:07:11,260
initializing it and saying hey we created this repo it needs to be tracked.

94
00:07:11,270 --> 00:07:15,130
So that's why we didn't have to do it in our terminal.

95
00:07:15,140 --> 00:07:19,260
All right so we've got a clean working tree here.

96
00:07:19,610 --> 00:07:24,980
Now a good rule of thumb something you're always going to want to do before you push your code up to

97
00:07:24,980 --> 00:07:30,890
your repo here is you always want to make sure you do a poll first so the steps that we want to accomplish

98
00:07:30,890 --> 00:07:39,080
here is do a good and get commit good poll and then the name of our branch.

99
00:07:39,080 --> 00:07:45,470
All right so we can pull the most current code into it to make sure it's up to date and then we'll do

100
00:07:45,470 --> 00:07:46,220
a push.

101
00:07:46,220 --> 00:07:52,430
All right and we do polls because if you have multiple people working on a codebase other people might

102
00:07:52,430 --> 00:07:57,770
be pushing to the repository like features that are completely finished and polished and that work.

103
00:07:57,770 --> 00:08:03,350
And you want to make sure that you're pulling in all that code first before you push so you don't have

104
00:08:03,350 --> 00:08:08,600
any like crazy merge conflicts in case you were working in the same file on the same line.

105
00:08:08,870 --> 00:08:14,890
All right so what we're going to do first is do a good pull origin.

106
00:08:14,900 --> 00:08:15,460
All right.

107
00:08:15,470 --> 00:08:22,820
And then the name of our branch which if we check over here somewhere will say here but we're on the

108
00:08:22,820 --> 00:08:23,960
master branch.

109
00:08:23,960 --> 00:08:24,520
All right.

110
00:08:24,680 --> 00:08:28,110
So Master and then go ahead and hit enter.

111
00:08:28,160 --> 00:08:29,810
It's going to ask you for your.

112
00:08:30,080 --> 00:08:35,540
Go ahead and throw on your password and it says Can it find remote master.

113
00:08:35,540 --> 00:08:36,320
Sorry about that.

114
00:08:36,320 --> 00:08:46,970
I want to do a good push Orjan master all right and then we'll do our key here and there you have it.

115
00:08:47,210 --> 00:08:49,220
All right it's almost finished there boom.

116
00:08:49,230 --> 00:08:55,920
So it's created the new branch for us it's created in Master and we've got a repo here so if we come

117
00:08:55,920 --> 00:09:03,780
over to our account and have a refresh on it you'll now see that we've got both of our files in here.

118
00:09:03,880 --> 00:09:05,160
Everything is being tracked.

119
00:09:05,160 --> 00:09:09,390
Everything is being pushed and everything is fantastic.

120
00:09:09,390 --> 00:09:09,750
All right.

121
00:09:09,750 --> 00:09:13,630
Now there's one more thing that I want to show you with these poll requests.

122
00:09:13,800 --> 00:09:18,510
So I mentioned earlier that there might be other developers working on the same project and they might

123
00:09:18,510 --> 00:09:22,250
push some changes up to this master branch for an example.

124
00:09:22,290 --> 00:09:23,810
So why don't we do this.

125
00:09:23,910 --> 00:09:29,560
Why don't we come into our get have and we didn't create a Rigney file before.

126
00:09:29,640 --> 00:09:31,180
Let's go ahead and add one now.

127
00:09:31,470 --> 00:09:37,350
So I'm going to hit add and then it has my first repo here and then let's make a change to this file

128
00:09:37,740 --> 00:09:39,640
and same.

129
00:09:40,020 --> 00:09:46,610
Everything is so great in life and I love to skate.

130
00:09:46,650 --> 00:09:48,270
I don't know just something crazy here.

131
00:09:48,610 --> 00:09:49,070
All right.

132
00:09:49,080 --> 00:09:56,270
And then we can go down to the bottom and do commit new file All right so now what we've done is we've

133
00:09:56,270 --> 00:10:01,610
just committed a new change from our repository and get a hub.

134
00:10:01,680 --> 00:10:04,240
All right but what about our local.

135
00:10:04,250 --> 00:10:06,110
We made this change on the remote server.

136
00:10:06,110 --> 00:10:08,440
What about our local branch here.

137
00:10:08,660 --> 00:10:09,790
So check this out.

138
00:10:09,950 --> 00:10:16,070
If I was to do a guest status I obviously have a clean working tree right.

139
00:10:16,310 --> 00:10:17,720
Well check this out.

140
00:10:18,170 --> 00:10:26,330
If we list out the items here I don't have a read any file in here but if I was to do a get Paul Orjan

141
00:10:26,450 --> 00:10:29,000
master and hit enter.

142
00:10:29,150 --> 00:10:32,470
We're now going to enter our password.

143
00:10:32,480 --> 00:10:35,360
I think I typed it wrong right.

144
00:10:35,360 --> 00:10:35,770
Boom.

145
00:10:35,780 --> 00:10:37,020
Check this out.

146
00:10:37,040 --> 00:10:40,670
We have now pulled in one file change with three insertions.

147
00:10:40,760 --> 00:10:48,670
So it took it in the read me file and it now has stored that read me file here on my local repository.

148
00:10:48,680 --> 00:10:55,820
So it's very important to keep your local branch up to date with the remote and we can do this by Remember

149
00:10:55,820 --> 00:11:04,040
following these specific steps get ad get commit get poll and then do your get push.

150
00:11:04,040 --> 00:11:06,100
So that is a wrap for this video.

151
00:11:06,200 --> 00:11:06,920
Let's move on.
