1 00:00:00,040 --> 00:00:00,080 "Git: Creating a remote repository to an existing project" 2 00:00:00,120 --> 00:00:00,160 Quentin Ducasse. 3 00:00:04,920 --> 00:00:06,960 -Hi. In this video, we are going to have a look 4 00:00:07,280 --> 00:00:12,840 at how we can actually push the counter package that we have online on GitHub. 5 00:00:13,160 --> 00:00:18,080 In order to do so, we already have the MyCounter repository stored locally. 6 00:00:18,400 --> 00:00:22,440 What we are going to do is double-click on it 7 00:00:22,760 --> 00:00:26,600 and go to the MyCounter working copy. We can go to the repository. 8 00:00:26,920 --> 00:00:30,760 What we are going to need is an actual remote. 9 00:00:31,080 --> 00:00:34,240 You can see that we can add a remote. What is a remote? 10 00:00:34,560 --> 00:00:38,120 It is the online counterpart of your local repository. 11 00:00:38,440 --> 00:00:42,000 We are going to need to create this. In order to do so, 12 00:00:42,320 --> 00:00:45,400 you can head to your GitHub page, go to Repositories 13 00:00:45,720 --> 00:00:52,920 and then go over to New to create the MyCounter package. 14 00:00:53,240 --> 00:00:58,160 "A small counter example in Pharo". 15 00:00:58,840 --> 00:01:00,320 We will create this repository. 16 00:01:00,640 --> 00:01:04,520 We now have an empty repository that is going to host 17 00:01:04,840 --> 00:01:08,360 our actual Pharo implementation of the counter. We will go back to Pharo. 18 00:01:08,680 --> 00:01:11,200 This is our repository. You can see that we have 3 commits. 19 00:01:11,520 --> 00:01:15,720 You should have maybe different commits or not the same names. 20 00:01:16,360 --> 00:01:20,280 Basically, you simply have to understand that those commits will be pushed 21 00:01:20,600 --> 00:01:24,600 to the GitHub repository. We go over to the Add remote button. 22 00:01:24,920 --> 00:01:28,000 We need to name it. It is good practice to name it "Origin". 23 00:01:28,560 --> 00:01:33,080 The remote URL can be found here under the HTTPS button. 24 00:01:33,400 --> 00:01:34,880 You can copy and paste this. 25 00:01:36,880 --> 00:01:38,840 Copy and paste. It should be your username 26 00:01:39,160 --> 00:01:41,960 slash the name you gave to the repository. Press Ok. 27 00:01:42,280 --> 00:01:43,400 It is adding the remote. 28 00:01:43,720 --> 00:01:47,640 Now, you can see that we have got a red stamp near the Push button. 29 00:01:47,960 --> 00:01:51,360 This means that there are some changes that have been committed 30 00:01:51,680 --> 00:01:53,720 because we can see that it is up to date, 31 00:01:54,040 --> 00:01:58,080 but they have not been pushed. So let us push them right now. Push. 32 00:01:58,800 --> 00:02:02,560 You can see that it is going to push these 3 commits. Press Ok. 33 00:02:02,880 --> 00:02:04,680 Push. So, it is pushing to Origin. 34 00:02:05,000 --> 00:02:09,200 Since we are using HTTPS, we will need to log into GitHub. 35 00:02:11,000 --> 00:02:15,560 You can store them if you plan on using it again. Ok. 36 00:02:16,280 --> 00:02:17,920 It is pushing to Origin. 37 00:02:18,560 --> 00:02:19,880 Now it should be done. 38 00:02:20,200 --> 00:02:23,200 We can see that the red stamp near the Push button has disappeared, 39 00:02:23,520 --> 00:02:25,480 so let us head over to GitHub. 40 00:02:26,520 --> 00:02:27,960 Let us refresh the page. 41 00:02:28,280 --> 00:02:31,840 You can see that we now have our project. 42 00:02:32,160 --> 00:02:34,960 If you go into src, you can see our MyCounter package, 43 00:02:35,280 --> 00:02:38,880 we can see the different classes. Everything is now hosted on GitHub. 44 00:02:39,200 --> 00:02:45,680 This is the way you can add a remote to your locally saved project.