diff --git a/docs/lab_08.html b/docs/lab_08.html index 58ff569..c280bcc 100644 --- a/docs/lab_08.html +++ b/docs/lab_08.html @@ -99,7 +99,7 @@

Goals

  • Learn how to commit changes to the repository
  • -

    Committing u using an editor

    +

    Committing using an editor

    Ok, enough about staging. Let’s commit what we have staged to the repository.

    When you used git commit previously to commit the initial version of the hello.js file to the repository, you included the -m flag that gave a comment on the command line. The commit command will allow you to interactively edit a comment for the commit.

    If you omit the -m flag from the command line, git will pop you into the editor of your choice. The editor is chosen from the following list (in priority order):

    @@ -128,6 +128,69 @@

    Committing u using an editor

    The “Waiting for Vim…” line comes from the vim program which sends the file to a running vim program and waits for the file to be closed. The rest of the output is the standard commit messages.

    Committing is the action of saving the changes to the repository. It is like taking a snapshot of the changes. You can always go back to this snapshot later.

    +

    Previously, when committing the hello.js file, you entered the command git commit -m “Your commit message”. The -m flag will accept the commit message inline, within the “double quotes”. If you enter the command git commit without the -m flag, your default terminal editor will open

    +

    If you omit the -m flag from the git commit command, git will open your default terminal editor.

    +

    The editor is chosen from the following list (in priority order):

    + +

    Here are some basic commands for vim:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyFunction
    ienters insert mode
    Escexits insert mode
    :puts vim in command mode
    wwrites the file
    qquits the editor
    !forces the editor to quit
    + +

    Once you have saved and exited the editor, you will see the commit message and the changes that were committed.

    +
    git commit
    +  Waiting for Vim...
    +  [master 569aa96] Using process.argv
    +  1 files changed, 1 insertions(+), 1 deletions(-)
    +
    +

    The “Waiting for Vim…” line comes from the vim program which sends the file to a running vim program and waits for the file to be closed. The rest of the output is the standard commit messages.

    Commit the change

    For this assignment we will use the -m flag so that you can commit in the simulation terminal. So commit now and check the status.

    @@ -135,7 +198,6 @@

    Commit the change

    Execute:

    git commit -m "Using process.argv"
    git status
    -

    You should see …

    Output:

    $ git status
    diff --git a/docs/screen.css b/docs/screen.css
    index 9851540..52e11f1 100644
    --- a/docs/screen.css
    +++ b/docs/screen.css
    @@ -164,11 +164,11 @@
       padding-right: calc(2rem + env(safe-area-inset-right));
       flex-grow: 1;
       counter-reset: content-heading-counter;
    -  outline: none; 
    +  outline: none;
     }
     
     #content p,
    -#content li, {
    +#content li {
       line-height: 125%;
     }
     
    @@ -428,3 +428,53 @@ h3 b {
         content: counter(content-heading-counter);
       }
     }
    +
    +
    +/* vim commands table (lab 8)
    +-------------------------------------------------------------------
    +*/
    +
    +.shortcuts code {
    +  color: #74e83f;
    +  background: #2e2e2e;
    +}
    +
    +.shortcuts {
    +  border-radius: 5px;
    +  padding: 8px;
    +  border: 1px solid #ddd;
    +}
    +.shortcuts th {
    +  text-align: left;
    +  border-bottom: 1px solid #ddd;
    +  margin-bottom: 4px;
    +}
    +
    +.shortcuts td {
    +  padding: 4px 0;
    +  border-bottom: 1px solid #ddd;
    +}
    +
    +.shortcuts td:nth-child(1),
    +.shortcuts th:nth-child(1) {
    +  padding-right: 8px;
    +  border-right: 1px solid #ddd;
    +  display: flex;
    +  justify-content: center;
    +}
    +
    +.shortcuts td:nth-child(2),
    +.shortcuts th:nth-child(2) {
    +  padding-left: 8px;
    +}
    +
    +.shortcuts td:nth-child(1) code {
    +  border-radius: 5px;
    +  color: #74e83f;
    +  background: #2e2e2e;
    +}
    +
    +.shortcuts tr:last-child td {
    +  border-bottom: none;
    +  padding-bottom: 0;
    +}
    \ No newline at end of file