‫Okay, so now I want show you how we can
‫push our code directly into Code Commit without using
‫the add file or upload file UI.
‫Because, this is obviously not much practice.
‫So for this, we have to go back to IAM and there's
‫something we haven't seen yet.
‫So, lets go to IAM and on the left hand side
‫find our users, find myself, and
‫I'm going to go to security credentials.
‫So here we've seen that we've created access keys
‫from before and we know this, but if you scroll down
‫there are two little options we missed.
‫The first one is SSH keys for AWS Code Commit
‫and the second one is HTTPS Git credentials
‫for AWS Code Commit.
‫So, if you're a Git expert and you already
‫know how Git works and you use SSH keys already,
‫you can just go ahead and upload your SSH public
‫key here, and your Git integration will be working.
‫You will go to clone URL and you would say clone SSH,
‫and you would copy this, uh, URL right here,
‫this SSH URL into your Git clone and you'll be done.
‫But for the newbies, if you've never done such thing before,
‫well we can do is get a little bit further and
‫use HTTPS Git credentials for Code Commit.
‫So how do we do this?
‫Well we can generate two, up to two username and passwords
‫directly to use HTTPS to connect to directly into
‫Code Commit.
‫So going into them you need to remember,
‫the, the fact that there's both SSH keys are supported
‫and HTTPS as well for Code Commit.
‫Lets go ahead and click on generate.
‫Here, my GIT credentials have been generated
‫and I'm going to download the credentials right here,
‫close.
‫Okay, excellent.
‫Now I can see that my GIT credential is active.
‫I can reset the password, make it inactive
‫and so on.
‫So, now, how do we go from here?
‫Well here, we can go back and use the clone URL
‫and we can do clone HTTPS.
‫In this case, it copies a HTTPS
‫type of URL.
‫So you don't need to know GIT going into the exam,
‫but just for the sake of this of this hands on,
‫if you wanna follow for the whole section
‫you need to install it.
‫Now, you don't need to be an expert, just follow along
‫with me and you'll be fine.
‫So to install GIT just add install Git,
‫and then your machine.
‫So if you have a Ubuntu, Windows and Mac then basically
‫you'll have to install something.
‫For me it's install GIT on Mac, and I'll just
‫follow the instructions.
‫So I just, I encourage you to do this and then
‫follow me when you install GIT.
‫So now that GIT is installed for me, you can make sure
‫of it by just typing the GIT command and you
‫should get minus minus version.
‫For example, it gives you the GIT version, I have 2.9.2.
‫And so, by just doing GIT, if your GIT version
‫you're good to go with this tutorial.
‫If not, you should just see how to basically install
‫GIT, such as you get the GIT command
‫on your platform.
‫So now we need the HTPS, code commit URL.
‫So clone URL, clone HTTPS and it right here.
‫I can also copy it from here if I wanted to,
‫just in case.
‫And then I will type, GIT clone
‫and then the whole URL right here.
‫Press enter.
‫And then you get asked for your username and
‫you will get asked for your password.
‫So let me just go ahead and enter this.
‫Here's my username,
‫and my password.
‫Press enter, and then when you're ready it's gonna
‫start to count objects remotely,
‫and checking the connectivity, and it's done.
‫So now we have a new folder called the nodejs app folder.
‫So I'll go in it, and then because I have a terminal
‫that's integrated with GIT, it tells me that
‫I am a master.
‫If I do "LS" I can see the index html file,
‫that we've had from before.
‫So this is quite awesome, because now we have the
‫index dot html file and we can start adding files
‫as we go along, later down in this course,
‫using the GIT command.
‫But this is proof that we just established a
‫GIT connectivity between our computer and the
‫(unintelligible)
‫using the HTPS credentials we setup IAM.
‫So now just to show you how things work with GIT,
‫I'm just going to copy a few files in this directory,
‫and then we're going to commit these files
‫straight into our (unintelligible)
‫So I'll just copy file from my nodejs-blue app
‫and I'll copy all of them into here.
‫So this is just a command, so just now if you do, uh
‫look what's in our directory we can that there is
‫the app.js, cron.yaml, index.html
‫and package.json file.
‫So, all these files have been copied from my
‫previous directory, into this current directory.
‫And so now you git status,
‫you get, uh, a message from GIT saying, "Hey, looks like
‫you have a few files that have been added right here,
‫in your (unintelligible) and they're un-tracked."
‫So for adding them we do GIT add and then we will
‫just, do dot to add the (unintelligible)
‫So now if you do GIT status again,
‫we can see that these files have been added and they're
‫new files.
‫So now we do a commit message saying,
‫"added missing files
‫to repository"
‫And you can commit whatever you want really.
‫So now, all these files have been added, into it.
‫And now we see my master is green,
‫and then finally what I have to do is GIT push,
‫to push my changes into Code Commit.
‫So now, as you can see, the commit has been pushed
‫to Code Commit and we should be all right.
‫Now, lets go and check Code Commit,
‫and lets refresh this page.
‫And yes indeed, my new files have been pushed directly
‫into my Code Commit repository.
‫So we have the four of them now, we can have like this
‫app.js file and we could edit it in here if we wanted to
‫but it's just really not best practice.
‫Usually you edit your code with a code editor.
‫And so, yes, it's good.
‫All, uh, our files have been uploaded into
‫this repository, so this is excellent.
‫We could also look at the commit history and see that,
‫yes indeed, um, there is a first version that was
‫uploaded like a while back, twenty minutes ago.
‫And now we just add the missing files to the repository,
‫so we can see the whole commit history and start
‫getting the hang of, like, how, code commit works.
‫So that's it, just remember, here for security
‫how things work so we can, connect using SSH or HTTPS.
‫And if you need some help, again with the connection steps
‫just click here and it will take you straight
‫to the documentation.
‫All right, that's it for this lecture,
‫I will see you in the next lecture.