Module 4c: Using SoureTree
Full Video Transcript:
Hey guys. For this session, we’re going to go over quickly how to commit your code into your local repository; how you pull from the remote repository where you forked from Indeni Knowledge; and then, we’re going to push your commit into your remote repository. All this will make sense as I’m walking through with you.
So, let’s go ahead and leverage the example we were using in a previous video. So, what we’re going to do is go ahead and go to SourceTree, and we’re going to go to file status, and as you’ll see, we’ll have all the changes that we have made to this repository. And, as you’ll notice, the difference is going to be any changes that you made in your computer that are not going to be the same as the repository that you forked from under Bitbucket right here. So, anything that’s been forked here is going to be a different representation or a different state than what you have generated out of your computer. And so, what we’re doing right now is we’re committing those changes. Added new code into script. I’m going to go ahead and click ‘Commit’.
We’re committing those changes into your local computer, meaning we’ve gone ahead and confirmed that that’s okay. We like the changes that we’ve made. We’re now going to assume that that’s what we consider the state of your local repository on your computer.
Now, the next thing we’re going to do is we’re going to do a pull. And, a pull is basically going to make a request to the repository on your Bitbucket repository and say, “Hey, if you made any changes in Bitbucket, please make sure that you’ve updated them onto my computer itself.” And, that’s what ‘Pull’ does.
Now, the next part is where we push any changes we made on our computer onto the repository here. It’s very important you follow through these steps, and the reason why is because there may have been changes that have happened on the Bitbucket repository, but are not going to be reflected on your local computer. And, the reason why is because those changes are not in sync with your local computer. In fact, anything that you alter on your local computer under Sublime Text is only affecting your local repository, but not the Bitbucket repository. So, it’s very important that you follow through those steps.
You go to ‘File Status’. You look at the changes that have been made. You make sure that those changes are what you want. You click ‘Commit’, and now those changes are going to be effectively considered what should be the normal state of your master, or your local repository. You then pull to update, and then you push from your local repository over to the Bitbucket. And, it’s going to ask you if it’s okay to access your Bitbucket repository to make those pushes. And, as soon as that happens and it goes through, you’ll notice that when you come back to your Bitbucket repository, you’ll have made some changes. If I click refresh, you’ll see the commit that was made, and you’ll also see the push that was made into here.
That’s it for this session. If you have any questions, please pose it onto the forums. Thank you.