Return to Video

Module 2, Video 13

  • 0:06 - 0:10
    In this lesson we're going to
    be creating a GitHub account.
  • 0:10 - 0:13
    We'll follow that up by creating
    a repository.
  • 0:13 - 0:19
    We’ll then add to our local environment
    the command line interface for Git.
  • 0:20 - 0:24
    We’ll generate some keys, and we’ll use
    those keys to add them back
  • 0:24 - 0:26
    into the online GitHub account
  • 0:26 - 0:29
    in order for us to get access
    from our local environment.
  • 0:30 - 0:34
    We’ll then clone the repository we
    created to our local machine.
  • 0:34 - 0:38
    We’ll add a file, and ultimately, to
    close it all off,
  • 0:38 - 0:43
    we will commit push those changes back
    into the GitHub repository.
  • 0:43 - 0:44
    So we're going to go full cycle.
  • 0:45 - 0:46
    So let's go ahead and get started.
  • 0:48 - 0:52
    We'll go ahead and navigate to
    github.com.
  • 0:53 - 0:58
    I'm going to go ahead and choose
    a username here.
  • 1:01 - 1:05
    I'll go with abeluserman.
  • 1:07 - 1:14
    I'll set an email of
    abel_user@hotmail.com.
  • 1:15 - 1:17
    And I’ll select a secret password.
  • 1:23 - 1:25
    Let's go ahead and click now on Sign up.
  • 1:30 - 1:32
    We’ll go ahead and go with the
    free plan.
  • 1:37 - 1:39
    We can go ahead and skip this screen.
  • 1:41 - 1:45
    And as you can see there,
    you can go ahead and start a project.
  • 1:47 - 1:48
    Let's go ahead and click on that.
  • 1:49 - 1:52
    And it's asking me to verify my email
    address.
  • 1:54 - 1:57
    When you go to your account,
    if you can't find it,
  • 1:57 - 2:00
    look for it under junk email,
    like in my case.
  • 2:01 - 2:04
    I'm going to go ahead and
    verify that email address.
  • 2:05 - 2:08
    And as you can see there, we’re back
    in GitHub.
  • 2:09 - 2:12
    So it is asking me here for a
    repository name.
  • 2:15 - 2:17
    I'll go ahead and call it “kali”.
  • 2:18 - 2:19
    I'll enter a description here,
  • 2:20 - 2:22
    just call it “Dummy Repo”.
  • 2:24 - 2:26
    I'll go ahead and leave it as public.
  • 2:29 - 2:31
    I will initialize it with a
    README,
  • 2:31 - 2:34
    that way we can go ahead and
    clone at as soon as we're done.
  • 2:35 - 2:38
    I'll go ahead and add a .gitignore file.
  • 2:38 - 2:42
    For our case, since we’ll be mostly
    writing JavaScript files,
  • 2:42 - 2:46
    I'll go ahead and use the Node gitignore.
  • 2:46 - 2:51
    This is simply done to ignore files that
    would not be copied over
  • 2:51 - 2:53
    by your entire team,
  • 2:53 - 2:58
    to simply ignore some of the files that
    fit that pattern within Node.
  • 2:58 - 3:00
    Then, I’m then going to
    add a license.
  • 3:01 - 3:03
    If you're not familiar with open source
    licenses,
  • 3:04 - 3:06
    the MIT License is the most permissive.
  • 3:06 - 3:09
    That means there are no restrictions,
    commercial or otherwise.
  • 3:10 - 3:12
    So I'm going to go ahead and create
    it now.
  • 3:16 - 3:19
    And as you can see there, we
    have a repository.
  • 3:20 - 3:24
    So we're ready to go when it comes
    to having something
  • 3:24 - 3:28
    on GitHub that we can clone to our local
    environment.
  • 3:28 - 3:33
    Now the next step is we're going to
    set up our local environment
  • 3:33 - 3:34
    that is within the machine.
  • 3:36 - 3:39
    To do that, we're going to go
    ahead and navigate to
  • 3:39 - 3:46
    git-scm.com/downloads.
  • 3:46 - 3:53
    As you can see there, it's one of the ones
    that the pull down suggestions is showing.
  • 3:54 - 4:00
    And from here, we're simply going to
    select the Windows version.
  • 4:02 - 4:07
    As you can see there, that content, or
    that installer, is already downloading.
  • 4:11 - 4:12
    There we go.
  • 4:12 - 4:13
    The file has downloaded.
  • 4:13 - 4:15
    Let's go ahead and execute it.
  • 4:32 - 4:36
    I'm gonna go ahead and select
    “Additional icons” in this case.
  • 4:47 - 4:49
    I'm going to go ahead and
    go with the default.
  • 5:03 - 5:06
    Now let's go ahead and launch
    the Git Bash.
  • 5:13 - 5:15
    Let's go ahead and
    make that window bigger.
  • 5:16 - 5:18
    OK, now we have a nice window.
  • 5:18 - 5:23
    Let's go ahead and add the username
    for the GitHub,
  • 5:24 - 5:26
    for the git environment,
    local git environment.
  • 5:27 - 5:35
    So we're going to enter
    “git config --global user.name”.
  • 5:37 - 5:38
    And in this case,
  • 5:42 - 5:46
    my username is abeluserman.
  • 5:48 - 5:49
    Let's go ahead and hit Return.
  • 5:50 - 5:52
    We’ll next enter
  • 5:56 - 5:57
    my email.
  • 6:02 - 6:10
    And in this case, it will be
    abel_user@hotmail.com.
  • 6:12 - 6:16
    We’ll next create a key that will
    generate locally
  • 6:16 - 6:20
    and then we will copy over to the GitHub
    environment.
  • 6:21 - 6:28
    And we do that by entering “ssh-keygen”.
  • 6:31 - 6:34
    We'll go ahead and enter, we’ll go
    with the defaults again.
  • 6:35 - 6:36
    We will not set a passphrase.
  • 6:37 - 6:41
    And as you can see there, that
    key has been created.
  • 6:42 - 6:45
    Next we’ll inspect that
    key at the command line.
  • 6:49 - 6:51
    Let's go ahead and copy that key.
  • 6:55 - 6:57
    Now that we have the key in our
    clipboard,
  • 6:57 - 7:01
    let's go ahead and go back to our account.
  • 7:02 - 7:05
    And let's go ahead and choose
    the repository.
  • 7:05 - 7:07
    Well actually, we don't need to do that,
  • 7:07 - 7:13
    we can simply select the account pull
    down there, the profile.
  • 7:14 - 7:16
    And let's go ahead and go to SSH keys.
  • 7:17 - 7:21
    And we’ll go ahead and
    add a new SSH key.
  • 7:21 - 7:29
    We’ll call this “Windows Client VM”,
    that's what this is.
  • 7:30 - 7:36
    I'm going to go ahead and paste here
    the...nope.
  • 7:37 - 7:39
    Let me go ahead and paste the key.
  • 7:41 - 7:43
    And I'm gonna go ahead and add it.
  • 7:47 - 7:49
    Now let's go ahead and go back
    to the Bash.
  • 7:55 - 7:57
    Let's go ahead and “clear”
    the screen.
  • 8:00 - 8:02
    Let's go ahead and create a development
    directory.
  • 8:05 - 8:05
    Call it “dev”.
  • 8:07 - 8:08
    “cd” into that.
  • 8:10 - 8:13
    So as you can see there, that's
    what the path is now.
  • 8:15 - 8:17
    I've gone ahead and cleared the
    screen.
  • 8:17 - 8:20
    Now we're going to go ahead and clone
    that repository.
  • 8:20 - 8:23
    We do that by entering “git clone”,
  • 8:23 - 8:27
    and we're going to get the address
    from a repository.
  • 8:27 - 8:30
    Let me go ahead and navigate to that now.
  • 8:31 - 8:33
    So it's just going to be abeluserman.
  • 8:36 - 8:40
    And I’m gonna click on the name
    of the repository.
  • 8:40 - 8:47
    Then on “Clone or download”
    and we're going to use the git address.
  • 8:47 - 8:49
    We're going to copy that to our clipboard.
  • 8:49 - 8:51
    Now I'm going to go ahead and
  • 8:51 - 8:54
    make sure I'm in the right spot
    and paste that here.
  • 8:56 - 8:57
    And I'm going to go ahead
    and hit Return.
  • 9:00 - 9:02
    If all goes well, we should pull
    down those files.
  • 9:03 - 9:06
    So go ahead and look at the
    directory structure.
  • 9:06 - 9:08
    And yes, we see "kali" there now.
  • 9:08 - 9:10
    Let's go ahead and enter into it.
  • 9:12 - 9:15
    And you can see there that we
    have the files from the repository.
  • 9:16 - 9:20
    If we enter “ls” with a “-a” option,
    we can see there that we have
  • 9:21 - 9:23
    the .gitignore as well.
  • 9:24 - 9:25
    So now, the next thing we're
    going to do
  • 9:25 - 9:29
    is that we're going to add
    a file to that repository.
  • 9:30 - 9:34
    Let's go ahead and open our file system.
  • 9:34 - 9:40
    And you can see there I am
    already inside of the path.
  • 9:40 - 9:46
    I'm going to go ahead and select
    kali, and I will simply add a new file.
  • 9:47 - 9:48
    Let's go ahead and do that.
  • 9:50 - 9:51
    We'll call it “hello”.
  • 9:53 - 9:54
    We’ll go ahead and open it.
  • 9:55 - 9:59
    And I think I used the wrong key.
  • 10:00 - 10:00
    There we go.
  • 10:01 - 10:04
    Let's go say, go ahead and say
    “Hello World!”
  • 10:05 - 10:06
    Go ahead and close it.
  • 10:08 - 10:08
    Save it.
  • 10:10 - 10:14
    And now we've added
    a file to our repository.
  • 10:14 - 10:19
    If we enter “git status” it'll say that
  • 10:19 - 10:22
    we have a new file that has not been
    added.
  • 10:22 - 10:24
    We can now go ahead and add that.
  • 10:25 - 10:26
    We’ll say “add”.
  • 10:26 - 10:31
    If you do “.” you simply
    add all of the files in your directory.
  • 10:31 - 10:35
    I'm simply going to
    enter “hello” in this case “.txt”.
  • 10:35 - 10:45
    Now if we do “git status”, you'll see
    that there is a new file now
  • 10:45 - 10:47
    that has been added.
  • 10:47 - 10:51
    The next thing we’ll do is we’ll enter
    a git commit
  • 10:53 - 10:55
    with the “-m” option.
  • 10:56 - 10:58
    We need to provide some feedback.
  • 10:59 - 11:06
    And in this case, I'll say simply
    “added hello.txt”.
  • 11:08 - 11:12
    Hit Return, and now we're ready
    to push to the directory.
  • 11:14 - 11:19
    We'll go ahead and enter “git push”,
    and this is the point in where,
  • 11:19 - 11:23
    if we added our keys correctly
    and everything has been done correctly,
  • 11:23 - 11:25
    we will be able to see the commit.
  • 11:26 - 11:27
    Let's go ahead and enter Return.
  • 11:31 - 11:36
    And yes, you can see there that
    the push was successful.
  • 11:36 - 11:39
    Let's go ahead and go over to our
    repository.
  • 11:40 - 11:42
    And let's go ahead and reload the page.
  • 11:43 - 11:46
    If all went well, we
    should be able to see our “hello”.
  • 11:47 - 11:48
    Now, if we click on it,
  • 11:50 - 11:52
    we should be able to see what we wrote.
  • 11:54 - 11:59
    And so if we review upon review what we
    did, we created a GitHub account.
  • 11:59 - 12:01
    We then created a repository.
  • 12:02 - 12:06
    We then installed the “git cli”,
    the command line interface.
  • 12:06 - 12:07
    We generated some keys.
  • 12:08 - 12:11
    We added that key that we generated, the
    public key,
  • 12:11 - 12:17
    to the GitHub repository -- well not just
    to the repository, but to the account.
  • 12:17 - 12:21
    We then cloned a repository to our
    local machine.
  • 12:21 - 12:24
    We added a file and, as the last step,
  • 12:24 - 12:27
    we committed and pushed those
    changes to the repository.
  • 12:27 - 12:30
    Go ahead and practice this a little bit.
  • 12:30 - 12:34
    Go through the cycle a couple times,
    especially that of creating a repository,
  • 12:34 - 12:38
    cloning it to your local environment,
    adding a file or two,
  • 12:38 - 12:41
    and then committing,
    pushing those changes.
Title:
Module 2, Video 13
Video Language:
English
Duration:
12:45

English subtitles

Revisions