1 00:00:00,160 --> 00:00:05,940 Hey guys in this video we'll be looking at how you can go about adding your projects which would be 2 00:00:05,940 --> 00:00:10,040 in Visual Studio to get help for source control purposes. 3 00:00:10,040 --> 00:00:16,620 Now GitHub has been around for quite some time as at the time of this recording it is owned by Microsoft 4 00:00:16,970 --> 00:00:21,890 and it is a development platform geared towards promoting open source. 5 00:00:21,900 --> 00:00:26,790 Open source essentially means that you're sharing your code you know you have a project you worked on. 6 00:00:26,850 --> 00:00:30,460 You want other people to partake in it maybe add to it. 7 00:00:30,460 --> 00:00:32,400 You know that's what gets up promotes. 8 00:00:32,480 --> 00:00:40,590 And so by using GitHub you can actually have a safe place to share your food or post your code just 9 00:00:40,600 --> 00:00:44,840 thinking it's like you have any technical difficulties your machine goes down or anything like that. 10 00:00:44,840 --> 00:00:50,310 You know it's here in the code that you can just download all of your latest work and continue. 11 00:00:50,310 --> 00:00:56,880 It also does version control which means that for each change that you make you can actually check in 12 00:00:57,150 --> 00:01:03,960 that portion and if something goes wrong you can roll back to the previous working portion. 13 00:01:03,960 --> 00:01:07,980 And so it's very flexible it's perfect for Team coding. 14 00:01:07,980 --> 00:01:12,130 And even as an individual you can reap many benefits from using it. 15 00:01:12,870 --> 00:01:19,170 So you get to get old by going to it gets up com and then you will be greeted with this landing page 16 00:01:19,170 --> 00:01:23,940 you can opt to sign up if you don't already have an account and it's pretty easy just the user name 17 00:01:24,390 --> 00:01:31,140 and email address and password and you can see that I already have an account so I would just sign in 18 00:01:36,980 --> 00:01:38,750 and this would be my account no. 19 00:01:39,320 --> 00:01:42,310 I usually use this for academic purposes. 20 00:01:42,320 --> 00:01:48,660 So today we want to get our school management project that we've been working on. 21 00:01:48,770 --> 00:01:53,200 And here it is we want to get this up on github. 22 00:01:53,360 --> 00:02:00,320 So at the time of creating this project to probably take it out to source control you probably didn't 23 00:02:00,380 --> 00:02:05,300 either way as you'd been going along you'd have noticed that little padlocks and red takes beside my 24 00:02:05,300 --> 00:02:06,420 files. 25 00:02:06,470 --> 00:02:13,820 This is an implicit or inherent source control mechanism given those by visual studio where we can actually 26 00:02:13,820 --> 00:02:19,760 check our versions right here on our own local machine and Visual Studio is allowing us to see what 27 00:02:19,760 --> 00:02:25,520 has changed since the time the file has was created or since the last version of that file. 28 00:02:25,520 --> 00:02:25,860 Right. 29 00:02:26,150 --> 00:02:30,230 So up until now we haven't checked in anything all of our ticks are there. 30 00:02:30,230 --> 00:02:35,270 If I expand the controllers for you to see that we've made changes to all of these controls so all of 31 00:02:35,270 --> 00:02:39,790 them have ticks know what we want to do is actually checking all the changes that we've made. 32 00:02:39,830 --> 00:02:45,380 Best practice of course would actually have us do shorter clones of chickens as opposed to building 33 00:02:45,380 --> 00:02:50,810 or to hold a feature or a whole host of features and then ticking you would want to probably a chicken 34 00:02:50,810 --> 00:02:56,570 per feature so that if anything went wrong you can always roll back and have one less feature than you 35 00:02:56,570 --> 00:02:57,950 did before the thing went wrong. 36 00:02:58,000 --> 00:02:58,250 Right. 37 00:02:58,520 --> 00:03:00,680 So now I'm going to show you two scenarios. 38 00:03:00,680 --> 00:03:05,930 You're either in scenario one where you didn't click at the source control and then your project would 39 00:03:05,930 --> 00:03:11,300 look like this or this is another project that I have and you'd see it has no ticks nose no padlocks 40 00:03:11,360 --> 00:03:14,840 and don't hear it is either project to source control. 41 00:03:14,930 --> 00:03:20,300 All right so if you're seeing this ad the source control then you can just go ahead and take that and 42 00:03:20,300 --> 00:03:21,300 you should see. 43 00:03:21,350 --> 00:03:28,400 If you don't see it it probably means you did not install the gate function in Visual Studio. 44 00:03:28,400 --> 00:03:33,590 So you want to go back to your visual studio installer and make sure you select get in the list of options 45 00:03:33,590 --> 00:03:40,430 that they give you but you can just go ahead and click it and that would create a local repository on 46 00:03:40,430 --> 00:03:47,910 your machine that would allow you to do version control and tracking right here on your machine. 47 00:03:47,930 --> 00:03:50,060 So this is processing for a while. 48 00:03:50,300 --> 00:03:55,800 Ultimately what we're aiming for is that once you have done that successfully then you should see changed 49 00:03:55,850 --> 00:04:02,370 to something like this where you see the gate symbol is the engine behind the source bunch. 50 00:04:02,390 --> 00:04:11,110 So there is a source control engine called Gate and this is the engine behind see get hub big buckets 51 00:04:11,110 --> 00:04:18,530 on quite a few others even as your dev ops formerly known as Office Online even as your dev ops is pushing 52 00:04:18,530 --> 00:04:19,970 that gets into art. 53 00:04:20,030 --> 00:04:26,750 Once you've added it successfully as a local repository then you should see something like this and 54 00:04:26,990 --> 00:04:34,720 you'll start seeing those padlocks and locks and and those ticks beside your files would have asked 55 00:04:34,720 --> 00:04:37,310 you to make sure you see all changes before we continue. 56 00:04:37,580 --> 00:04:40,790 And then in the team explore what you will see. 57 00:04:40,820 --> 00:04:46,580 I have quite a few here so you may not have this extensive list on the your local gets repositories 58 00:04:46,650 --> 00:04:48,290 and repositories section. 59 00:04:48,350 --> 00:04:53,500 But for me I have the option of a zero dev ops and GitHub. 60 00:04:53,510 --> 00:04:56,620 So a desert of ops is also free you can sign up for that one. 61 00:04:57,230 --> 00:05:01,940 You'd need a lot of icons to get through with this one but Toby Toby's open to everybody regardless 62 00:05:01,940 --> 00:05:03,650 of if you have a level codes or not. 63 00:05:03,650 --> 00:05:07,820 So that's why I'm using GitHub and either way Microsoft owns both. 64 00:05:07,850 --> 00:05:10,810 So it's becoming more homogenous as we go along. 65 00:05:10,850 --> 00:05:14,440 We can always go ahead and see connect. 66 00:05:14,620 --> 00:05:20,900 And if you're not seeing gets then once again you will probably want to check your your visual studio 67 00:05:20,900 --> 00:05:25,790 installer and make sure that you have the visual studio tools for it ghetto. 68 00:05:25,910 --> 00:05:29,630 I want to show you guys a nice easy way to get started. 69 00:05:29,630 --> 00:05:34,370 You can right click on your solution and then we go to commit. 70 00:05:34,400 --> 00:05:37,370 So I have a few changes that need to be committed. 71 00:05:37,370 --> 00:05:42,670 Committing means that you're actually going to send these changes to the source lunch all year. 72 00:05:42,690 --> 00:05:46,930 You're making a check you're checking in code literally right. 73 00:05:47,360 --> 00:05:54,740 So I'm going to submit all of these changes to my repository so I right click on the solution and advise 74 00:05:54,740 --> 00:06:00,500 you do it at the solution level so that everything that falls on the needs in the project or projects 75 00:06:00,500 --> 00:06:02,920 will get checked in each time. 76 00:06:02,930 --> 00:06:08,690 So it does right click that you go to commit and then that changes the menu to ask you which branch 77 00:06:08,990 --> 00:06:16,670 master is the default branch and you have to enter a message or the purpose of a message is to let your 78 00:06:16,670 --> 00:06:20,800 team know or even you because maybe you look back at it. 79 00:06:20,900 --> 00:06:23,840 I wonder what change was made here. 80 00:06:23,840 --> 00:06:28,610 All right so you just put in a comment to see or what new features were added. 81 00:06:28,610 --> 00:06:30,320 So let me just do that quickly. 82 00:06:30,320 --> 00:06:30,770 OK. 83 00:06:30,800 --> 00:06:35,780 So you can see that my comment is quite long and there are things that I did that I'm not capturing 84 00:06:35,780 --> 00:06:41,740 here I said in the beginning that it's kind of bad practice to be checking in code after a very prolonged 85 00:06:41,740 --> 00:06:42,300 period. 86 00:06:42,580 --> 00:06:45,400 So you'd want your comment just to tell the whole story. 87 00:06:45,410 --> 00:06:51,760 And also in order to tell the whole stories bits of short stories then have one big story and then try 88 00:06:51,760 --> 00:06:53,940 to capture it all in one big epistle or right. 89 00:06:54,040 --> 00:06:57,580 We have added controllers since the start of the project. 90 00:06:57,700 --> 00:07:04,960 We have added the data model and we added useful authentication functionality of course with each of 91 00:07:04,960 --> 00:07:11,440 these changes what we would want to do is spell out OK this is what was done this change. 92 00:07:11,440 --> 00:07:13,270 This was all was done for that change right. 93 00:07:13,270 --> 00:07:19,710 So once again by practice here but I'm teaching you as you go along so you learn for your own purposes 94 00:07:19,720 --> 00:07:20,750 not to do it. 95 00:07:21,070 --> 00:07:25,690 And then you see come it's all and you'd be tempted to dislike it but once again I want to show you 96 00:07:25,690 --> 00:07:32,200 the simpler we can go and this don't it and commit all and sync. 97 00:07:32,830 --> 00:07:39,160 So what sink would do know is ask you okay come all to the local repository and you want to sync it 98 00:07:39,160 --> 00:07:41,030 with where exactly. 99 00:07:41,030 --> 00:07:47,200 So because we don't have a remote repository which would be one of the zero dev ops or ghetto bar or 100 00:07:47,560 --> 00:07:52,160 otherwise it's asking us where do we want to sync it to. 101 00:07:52,180 --> 00:07:52,480 All right. 102 00:07:52,510 --> 00:07:57,580 So in order to facilitate this sync what we would do is just connect to GitHub so we can just go ahead 103 00:07:57,580 --> 00:07:58,680 and connect. 104 00:07:58,810 --> 00:08:01,550 And then this will prompt us to sign in with our user name. 105 00:08:01,560 --> 00:08:02,230 So the. 106 00:08:02,260 --> 00:08:09,190 Quickly and then once you sign it with Utah we'll see all of our repositories listed. 107 00:08:09,470 --> 00:08:09,770 OK. 108 00:08:09,800 --> 00:08:18,140 So after connecting to get hub here in Visual Studio What do you want to do is go to the home and click 109 00:08:18,140 --> 00:08:23,870 sync and then one day I will ask you is it will give you the option. 110 00:08:24,060 --> 00:08:30,330 To get up so you can just publish the ghetto and then we'll give you a tiny menu where it just validates 111 00:08:30,360 --> 00:08:35,580 allows it to change these if you want you can change the name of the repository as it would appear on 112 00:08:35,580 --> 00:08:37,580 GitHub so you can just see. 113 00:08:37,580 --> 00:08:42,180 School of Management or you can add a short description here. 114 00:08:42,240 --> 00:08:46,520 So the project so I'm not a typo is a good description. 115 00:08:46,600 --> 00:08:50,560 Is I putting in a good description here created for the Udemy course. 116 00:08:50,560 --> 00:08:56,040 Learn you've done it MVC with entity framework database first does that's the course that this video 117 00:08:56,040 --> 00:08:57,820 is associated with then. 118 00:08:57,840 --> 00:09:03,180 So this this serves the purpose of letting anybody who stumbles upon the code have an idea of why this 119 00:09:03,180 --> 00:09:05,470 was created or what it's for. 120 00:09:05,520 --> 00:09:12,480 You can opt to have it as private or public private means not the whole world won't be able to access 121 00:09:12,480 --> 00:09:13,260 that code. 122 00:09:13,290 --> 00:09:18,990 Public means that well the whole world can access that code if they go on gets up and then you can just 123 00:09:19,440 --> 00:09:21,540 publish all right. 124 00:09:21,540 --> 00:09:27,800 So once that action is completed you'll see another change heroes show you the direct link to your repository 125 00:09:27,810 --> 00:09:29,040 there on GitHub dot com. 126 00:09:29,310 --> 00:09:34,560 So if you click that to navigates your browser to that they'll also give you the ability to manage a 127 00:09:34,560 --> 00:09:40,950 few things from GitHub right here in visual studio so you really don't have to go to the Web site much. 128 00:09:40,950 --> 00:09:44,210 After just creating your own thread. 129 00:09:44,250 --> 00:09:52,140 So if I go about though and I refresh here then I would see that I have the repository as was promised. 130 00:09:52,140 --> 00:09:52,450 All right. 131 00:09:52,470 --> 00:09:58,890 So I can go to school management and then it will let me know that four whole commits were made because 132 00:09:58,890 --> 00:10:04,740 what happened was that I on my computer I was making comments to my local repository you might not have 133 00:10:04,740 --> 00:10:10,680 been so you would see probably one comment made but all of mine that weren't being made locally were 134 00:10:10,680 --> 00:10:15,450 all pushed to GitHub so GitHub has the same record of changes. 135 00:10:15,490 --> 00:10:21,560 Know that my local repository had as I was going along going along using it only locally. 136 00:10:21,600 --> 00:10:29,260 So here you see the code and if you follow this thing you would be able to see this code. 137 00:10:29,400 --> 00:10:36,540 At any rate you know using getup which allows you to share it with facilitators or your friends and 138 00:10:36,540 --> 00:10:38,950 share whatever it is you're trying to do. 139 00:10:39,030 --> 00:10:44,610 If if you're attempting something and you know it's not working out you can just send it to github somebody 140 00:10:44,610 --> 00:10:51,300 to check on its though it is ill advised to chicken or commit code that doesn't work. 141 00:10:51,300 --> 00:10:57,650 So I would advise you that if it hits ghetto it should be operational meaning if I come along some blow 142 00:10:57,650 --> 00:11:05,340 up on it then try to download it and I can always either clone it and get the source files synchronize 143 00:11:05,340 --> 00:11:07,980 with my visual studio or I can just don't load it in a zip. 144 00:11:08,010 --> 00:11:15,060 Or just as the owner I can open invisible visual studio or I can just download the zip here as as a 145 00:11:15,060 --> 00:11:19,320 passer by and have the project as you would have uploaded it. 146 00:11:19,440 --> 00:11:21,790 So that's how you get your code of the ghetto. 147 00:11:21,800 --> 00:11:29,760 GetUp is very cool it is very powerful and I hope you get through this exercise pretty well if you have 148 00:11:29,760 --> 00:11:32,400 any difficulties feel free to drop me a line and let me know.