1 00:00:06,110 --> 00:00:11,180 Hello, colleagues, in this lesson, we are going to discuss what remote repositories are and how to 2 00:00:11,180 --> 00:00:11,880 work with them. 3 00:00:12,290 --> 00:00:17,360 I will tell you what is the source code hosting and why do we need it together? 4 00:00:17,390 --> 00:00:21,650 We'll review the most popular in services and we'll compare them. 5 00:00:21,980 --> 00:00:24,600 And this will create a remote repository. 6 00:00:24,980 --> 00:00:28,730 I'm going to show you how to push a local repository to the remote. 7 00:00:29,000 --> 00:00:31,670 You run such command as get push today. 8 00:00:32,150 --> 00:00:36,080 I will show you what is with me dot and defile and when you can use it. 9 00:00:36,620 --> 00:00:41,930 And at the end of the lesson, I will show you how you can clone an existing repository for your computer. 10 00:00:42,230 --> 00:00:45,800 Let's start before we start looking at examples. 11 00:00:45,800 --> 00:00:46,970 Let's understand first. 12 00:00:47,000 --> 00:00:49,000 Why do we need remote repositories? 13 00:00:49,340 --> 00:00:55,640 Usually where we work as a team with other software engineers and we need to collaborate with them somehow 14 00:00:55,940 --> 00:00:59,810 and we want to have a single place with our latest version of the code. 15 00:01:00,110 --> 00:01:07,280 Remote repository will help us with this remote repository is the same repository that we already created 16 00:01:07,280 --> 00:01:13,100 in this course, but it's just hosted on the Internet and available online 24/7. 17 00:01:13,760 --> 00:01:18,020 And every developer updates is a remote repository on the regular basis. 18 00:01:18,320 --> 00:01:24,470 Collaborating with remote repositories means that you know how to push changes, how to pull changes 19 00:01:24,470 --> 00:01:29,520 from there and how to resolve conflicts in the source code in case you have any. 20 00:01:29,930 --> 00:01:36,860 Also, we need to know how to set a remote repository beside that, and this course will learn how to 21 00:01:36,860 --> 00:01:38,630 manage various remote branches. 22 00:01:39,140 --> 00:01:45,290 Each developer still has a repository on the local machine, but there is one single place where the 23 00:01:45,290 --> 00:01:48,910 code of the latest version should be placed to start with. 24 00:01:48,920 --> 00:01:52,910 Let's hold a brief overview of what Hosten for remote repositories you can use today. 25 00:01:53,360 --> 00:01:57,830 On this slide, you can see three of the most popular Hosten forget repositories. 26 00:01:58,160 --> 00:02:03,620 They are GitHub, probably one of the most popular Hosten in the world. 27 00:02:03,860 --> 00:02:09,470 It supports a lot of features that supports and helped you to create efficient continuous integration 28 00:02:09,470 --> 00:02:11,380 and continuous deployments processes. 29 00:02:11,930 --> 00:02:15,680 Microsoft acquired GitHub repository for huge amount of money. 30 00:02:16,070 --> 00:02:21,860 And you know, if Microsoft buy something that means a lot of product owners, marketers and developers 31 00:02:21,980 --> 00:02:26,690 start proactively developing the product to win the competition with other vendors. 32 00:02:27,350 --> 00:02:31,040 Mid-Market, it is a great tool made and supported by Atlassian. 33 00:02:31,400 --> 00:02:37,100 This tool is mostly liked by developers because of the great integration with other licensed products 34 00:02:37,130 --> 00:02:40,340 like such popular issue tracking system as JIRA. 35 00:02:40,730 --> 00:02:46,790 It is very convenient to use this tool in conjunction with JIRA and Knowledge Base by Atlassian called 36 00:02:46,790 --> 00:02:48,770 Confluence Getler. 37 00:02:49,250 --> 00:02:52,010 One more popular Hosten forget repositories. 38 00:02:52,190 --> 00:02:57,380 And to be honest, it is really hard to compare this one with previous to more or less. 39 00:02:57,380 --> 00:03:01,130 All these three source code repositories have similar features. 40 00:03:01,640 --> 00:03:06,950 Besides storing all of the source code, Goodlove offers similar features for each track and project 41 00:03:06,950 --> 00:03:08,240 management as GitHub. 42 00:03:08,840 --> 00:03:13,130 What we are going to choose for storing source code for all my students. 43 00:03:13,130 --> 00:03:19,820 I use repositories on the GitHub for storing source code of my own projects, mobile and web apps which 44 00:03:19,820 --> 00:03:21,440 we develop inside my company. 45 00:03:21,740 --> 00:03:24,050 We use BitBucket premolars. 46 00:03:24,050 --> 00:03:29,840 This is because the fact that long time ago BitBucket offered possibility to create private repositories 47 00:03:29,840 --> 00:03:30,650 free of charge. 48 00:03:31,040 --> 00:03:33,350 While this was paid feature in the GitHub. 49 00:03:33,800 --> 00:03:38,480 Today you can create is a public or private repository on the GitHub for free too. 50 00:03:39,110 --> 00:03:45,200 And just in one more time, no matter which online positive we are going to choose, configuration will 51 00:03:45,200 --> 00:03:45,850 be the same. 52 00:03:46,520 --> 00:03:48,170 So let's start our demo. 53 00:03:48,830 --> 00:03:51,740 First of all, we have to create account on the GitHub. 54 00:03:52,010 --> 00:03:55,670 The process of account registration is pretty intuitive and easy. 55 00:03:55,880 --> 00:03:58,190 That's why I won't focus on that. 56 00:03:58,670 --> 00:04:01,940 After you logged in, click on Plus sign here. 57 00:04:02,720 --> 00:04:06,800 Select new repository, create name of your repository. 58 00:04:07,250 --> 00:04:10,580 You can choose a name you would like for the demo purposes. 59 00:04:10,580 --> 00:04:14,660 Let me learn it yet we can skip description. 60 00:04:14,660 --> 00:04:18,920 As of now I want to make it public to be able to share it with you team. 61 00:04:19,280 --> 00:04:23,350 You can keep your own repository, private or public, as you wish. 62 00:04:23,990 --> 00:04:27,380 We don't need to let me read me nor get ignore. 63 00:04:27,800 --> 00:04:29,660 We'll add this by ourselves. 64 00:04:29,990 --> 00:04:36,470 Just press big green button, create repository and here you can find hints what to do next. 65 00:04:36,470 --> 00:04:38,730 In case we don't have a local repository. 66 00:04:38,800 --> 00:04:42,470 One case we want to push local repository to this hosting. 67 00:04:43,010 --> 00:04:50,400 What is also worth to mention is that you can establish connection with it via HTTP protocol or S.H. 68 00:04:50,900 --> 00:04:56,480 establish in connection with the SSA protocol requires additional configuration and I will show you 69 00:04:56,480 --> 00:05:03,020 that in the separate lesson to establish connection via https, no additional configuration is a. 70 00:05:03,140 --> 00:05:10,180 What in this lesson, I will show you how to push files to the Hosten with the help of HTTPS protocol, 71 00:05:10,700 --> 00:05:13,720 that's why we need to click here, OK? 72 00:05:14,000 --> 00:05:20,270 What we need to do now, we need to connect our local repository with this remote hosten how to do this. 73 00:05:20,630 --> 00:05:21,970 Here we can see hints. 74 00:05:22,790 --> 00:05:29,360 Let's go back to our get back and our local repository, first of all, to check that your local repository 75 00:05:29,360 --> 00:05:38,330 isn't connected with any remote repository yet enters the next command, gets remote with option B and 76 00:05:38,330 --> 00:05:43,520 we see that our local repository isn't connected with any other remote repository. 77 00:05:43,910 --> 00:05:46,730 OK, then let's perform the next command. 78 00:05:47,540 --> 00:05:50,780 Copy this https eurorail from here. 79 00:05:51,320 --> 00:05:52,310 Press control and. 80 00:05:53,300 --> 00:06:02,120 Now let's type the following year remote at our region and paste link which we copied to paste link 81 00:06:02,120 --> 00:06:06,080 and it bash press mouse right click and select based option. 82 00:06:06,920 --> 00:06:08,150 But what is a region. 83 00:06:08,510 --> 00:06:13,040 Our region is a shorthand name for the remote repository to be more specific. 84 00:06:13,070 --> 00:06:18,110 This word is used instead of the repository URL to make reference and much easier. 85 00:06:19,010 --> 00:06:25,730 Now we need to connect our local branch master with the master branch in the remote repository all the 86 00:06:25,730 --> 00:06:27,280 time during the development. 87 00:06:27,390 --> 00:06:31,600 Are going to have two versions of the one branch that you will try to synchronize. 88 00:06:32,090 --> 00:06:37,340 For example, if you have Master Branch in your repository, you should have a region master branch 89 00:06:37,340 --> 00:06:42,150 in the remote repository to connect local master branch with a remote master branch. 90 00:06:42,170 --> 00:06:47,720 We have to execute the next command, yet push our region was option. 91 00:06:47,720 --> 00:06:52,610 You must option U stands for upstream. 92 00:06:53,310 --> 00:06:59,150 This option automatically sets the upstream US link in our RAPPA to its central one. 93 00:06:59,750 --> 00:07:03,020 After this one will tell you to pull changes. 94 00:07:03,020 --> 00:07:07,430 It will understand that I want to pull changes exactly from this region. 95 00:07:07,430 --> 00:07:09,390 Branch press enter. 96 00:07:10,010 --> 00:07:16,370 It didn't ask me GitHub login and password because I already stored in my credential manager on my computer. 97 00:07:17,000 --> 00:07:23,660 But most likely you will be asked to enter your GitHub login and password follows the hands on the pop 98 00:07:23,660 --> 00:07:24,480 up windows. 99 00:07:25,130 --> 00:07:29,870 Now let's go back to the Web browser to explore our regional repository. 100 00:07:30,380 --> 00:07:31,540 Refresh the page. 101 00:07:32,030 --> 00:07:33,110 Congratulations. 102 00:07:33,560 --> 00:07:37,420 And you see that you have pushed your changes to the remote git repository. 103 00:07:38,000 --> 00:07:40,870 By the way, can you see the repository description? 104 00:07:41,420 --> 00:07:47,780 Usually people use read me dot and file to put their repository description by convention. 105 00:07:47,780 --> 00:07:51,700 Content on this file is displayed on the homepage of the repository. 106 00:07:52,310 --> 00:07:59,090 That's why, in case you want to put some description here, just to just read me file like we did. 107 00:07:59,920 --> 00:08:05,890 Then one more thing that I want to show you today is how you can clone a remote repository, for example, 108 00:08:05,890 --> 00:08:11,070 the first day you journey to a new job and started work on the new project, you can ask your tech lead 109 00:08:11,080 --> 00:08:17,980 where the repository are and you will be provided with the link you have to clone remote repository 110 00:08:17,980 --> 00:08:22,720 to your machine to be able to work on the source code together with the whole team. 111 00:08:23,500 --> 00:08:25,540 How to clone existing repository. 112 00:08:26,050 --> 00:08:27,550 Let me show you example. 113 00:08:28,180 --> 00:08:31,300 Here is a project with a source code for my Java students. 114 00:08:31,660 --> 00:08:37,450 Let me clone it to my local computer so that I could investigate the source code and push changes that 115 00:08:37,450 --> 00:08:43,630 I want to press the green button and select https for the sake of the example. 116 00:08:44,230 --> 00:08:47,590 Corbisiero now on your computer. 117 00:08:47,600 --> 00:08:50,680 Navigate to any place on a file system you wish. 118 00:08:51,290 --> 00:08:58,060 Choose a directory where you would like to store the source code of this project openly bash in that 119 00:08:58,060 --> 00:09:00,220 directory and execute the next command. 120 00:09:02,610 --> 00:09:07,260 Git clone, mouse, right, click paste and press the button. 121 00:09:12,420 --> 00:09:18,750 Now you can check your folder and you will find all files from remote repository cloned here, including 122 00:09:18,750 --> 00:09:23,670 the folder of the repository here you can find doget folder for this project. 123 00:09:24,090 --> 00:09:25,110 Congratulations. 124 00:09:25,950 --> 00:09:28,980 Now, let's recap what we have learned in this lesson. 125 00:09:29,760 --> 00:09:35,580 Today, we learned what hosting for Repositories is one of the most popular gifts Hosten. 126 00:09:36,060 --> 00:09:38,880 After that, we created account on the GitHub. 127 00:09:39,360 --> 00:09:43,210 In this lesson, you saw how to check remote repository if needed. 128 00:09:43,800 --> 00:09:49,550 Now you can connect your remote repository with the local one and push all necessary changes. 129 00:09:50,100 --> 00:09:53,310 Also, you learned how to set up stream for the gift. 130 00:09:53,310 --> 00:09:58,630 Branch will use this knowledge in the next lessons when will create other branches. 131 00:09:59,220 --> 00:10:05,640 Now you know why you may need README file in your repository and what you have to write there. 132 00:10:06,330 --> 00:10:11,710 In this lesson we reviewed to get KLON Command and I believe you understand how you can clone a repository 133 00:10:11,710 --> 00:10:12,710 to your local machine. 134 00:10:13,560 --> 00:10:14,860 That's all for this lesson. 135 00:10:15,240 --> 00:10:18,390 Thanks a lot for your attention and see you in the next lesson.