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