Making Changes

Tim Buchalka's Learn Programming Academy
A free video tutorial from Tim Buchalka's Learn Programming Academy
Professional Programmers and Teachers - 1M+ students
4.5 instructor rating • 52 courses • 1,032,947 students

Lecture description

Making changes to a repository that you cloned is the same as making changes to a repository that you created. We also explore what it means in the context of collaboration, and get a sneak peak at what pull requests are.

Learn more from the full course

Git & GitHub Masterclass

Add real world development team skills for version control and source control to your resume & programming arsenal!

11:34:11 of on-demand video • Updated November 2020

  • Use Git and GitHub in the way that modern development teams use them.
  • Understand the ideal structure of a repository.
  • Learn how GitHub will enable great collaboration in a development team.
  • Master the git commands that will help you explore any repository.
  • Leverage Markdown in your GitHub repositories.
  • Publish your repositories in public websites through GitHub Pages.
  • Feel comfortable contributing to a repository, whether open source or as part of your job.
  • Understand how GitHub is the foundation for more advanced development practices such as CI/CD and DevOps.
English [Auto] So in the produce lectures we formed our repository that we found over on github. And of course after that we cloned it. So we have that repository available here. No computer locally. What I want to do in this electorate is make some changes. Explore a bit more about what this code ease and once I understand a bit more about what it contains say can make some modifications to it so I can eventually just do what I have what we've really learned how to do which is just to stage those changes commit them and push them over to our repository mainly what I want to show you and what the next lecture is going to be about is how to reverse changes if something wrong happens. For example let's say that we have these HDL boilerplate code that we have already cloned and which ads are exploring IDs with what we've seen in the past two lectures have discovered that in the dist folder there EES for a for each tier mail file which is just used to be displayed whenever the page that the user might be looking for when using these code is not found. So let's say that we have used these basic code to create our own Web page. Well this is the one that would be displayed when the users navigate somewhere. That is actually not available. And so what we want to do is make some genuine here maybe make these file look more like what's our application should look like now before doing any changes. Let me go ahead and show you what is inside of that file. So let me just open here on my finder the repository or the or the folder and I know that in these there's these four or four file so just go ahead and open these on google chrome so I can show you how these spaces going to look like a man. So I can see directly here that it has some code that these Josephs play in patients. So. OK great. The next thing that we would want to do is just make some changes in here. And again the thinking here is not to learn what HDL male or GCSE coding here do. Let's just make a few changes in here so we know that this is actually working. So let's for example change the title that instead of basement found it's going to say woops not found or something that. Let's go ahead and change the course in here so instead of the claws that these CEOs says finally is going to be using we see some different colors. Just go ahead and make some changes in here so you know that these failed this year that this file contains changes that you yourself made for example one and one other thing that I may do aside from changing the title is gene you want what is actually going to be displaying the body of that each DNA. So again I'm going to change this here two loops not found and I made some changes here in the paragraph. So it actually reads get and get help Master Class. So this is definitely something that I have edited myself and of course we can check out the blame and these couple of lines that I changed have me as the one to blame for the changes while the others have someone else. The original author of these fail to blame. So once I've made those changes I can do something that we've already learned how to do. So I'm going to head back over to my terminal. I'm going to do a get statues to take a look at the father had been modified and they can definitely see that for a for each year male father was modified in here. And so what I can do is add that file or in fact if I don't want to add files every single time I can commit directly and add a dash a parameter in here. So similar to the dash and two of the message the dash M is actually going to add these already tracked files to the staged section before actually committing them. So this is just a shortcut. So you don't have to actually add all of those files before committing. And so let me just add a messaging here change for a four page something like that. And so now if I do get statues I see that there is nothing to compare to bot that the local branch is ahead of the remote branch so I will have to push everything to the origin because that is in my master branch which she is again. So far the only branch that I have so I book everything. And after just a few seconds I just see that everything is now over on my remote master branch if I navigate then over to keep up I am going to let me just refresh the patient here see that there are now seventeen hundred comments. So one more. And the most recent one was made by me. If I go ahead and explore the comet's den which of course he is going to contain the information that we already know of. If I navigate over to the comet I see what has changed. So a couple of lines in here. I see that there were three additions and three deletions. And if I held back over to the code and I inspect the dist folder first and then open there for a further HDMI file and take a look at the history I see that indeed my latest Comet ISON here. And also you fi inspect the blame there are in here a few lines that that track back to me so I'm no one to blame for a couple of changes here and you can see how the changes are from three minutes ago which just matches to when I made changes. Now the thing that I want to make emphasising here is that these comments was made to my repository. If we go ahead and inspect the original repository our code is nowhere to be found. In fact immediately you notice that the committee here there is one less commit and the committee list there is our committee is not here of course. And if we go over to the this folder and open the forum for each email file and take a look at the history our committee is not here. And so we are nowhere to be found when listing the blames. So this is just something that I want to make emphasis on. So it is clear that it is on your own repository. The one that is going to be received those updates. So you have no way of updating the code that accessed over on the original repository. You want to call it that way unless you do some other thing that is called a pull request. We are not yet going to take a look at your requests but I want to give you a sneak peek. Go ahead and here in your repository on your code tab click on the new pull request button that exists right next to the selector for the branches. Notice in here that you are able to push from your master branch over to the master branch of the original contributors the original branch. Again we're not yet going to be getting deep into what a pull request is but is it is basically a way in which you can contribute to the original repository so suddenly forking a repository makes a bit more sense because you can make your own modifications and eventually contribute to the original repository. So in fact if you cloned only just go ahead and show you that if you have cloned my repository they'd give GitHub masterclass where we have this index and let's say that made some changes to this index for example I'm going to edit directly from github but of course this could happen from anywhere. Let's just add another day off right down below here and say that this is important. Make the commit and once the comet is made navigate back to the code and create a new pull request you would be able to push over to my repository so making a pull request over to my repository is going to push your changes over to my original repository. And of course I encourage you to go ahead and explore what happens after you do this. Again we're going to dig deeper into what the request is and how it's going to affect the original repository. But I just wanted to mention that this is a way in which you can further contribute to our repository with those changes that we have just made to the repository that we fought so the entire process would be this one that we have just seen throughout this lecture. You make some changes. You of course commit them push them over to your remote and your from your remote. Eventually you create Apple request which is just basically adding some comments in here. All of those changes that you have made and creating the pull request. So far though I want to emphasize as well this is not yet part of the original repository. But this is as far as you can go as a person who forged the original repository creating a pull request. Basically you Bush over to the original repository board the owner of the original repository has to accept that request. These were the whole steps that you would made if you want to contribute to a particular repository which will result on the owner. And by here might you real github account so the owner will receive these bolt requests. So this is that Bill request I received from the other account and it is the owner or all of those contributors the ones that can accept the request but again these are going to be things that we see later. I just want you to understand that once you have pushed your code over to your local repository the next step would be to create a pull request in case you want to contribute to the original repository. Now in the next lecture what we are going to focus on ease on how can we undo changes that we have made to our repository. If we have made some changes that broke something What is it that we can do. Since we are using version control to make sure that things work again.