Lab 2 Web Standards and Version Control Software

This second lab allowed me to become more acquainted with best practices on the web and tracking changes through the Git version control system. I normally use Git through a GUI built into Visual Studio Code, and using it through the command line was a new experience I found beneficial. Following this lab, I took the time to go through the Git How To website to better understand its fundamentals.

Procedure

During this lab

  1. In ~/public_html/cs133/lab2, git init was used to initialise a Git repository.
  2. The provided code was pasted into a file created using nano lab2.html.
  3. The correct permissions to make the file accessible through the web server were set using chmod 705 lab2.html.
  4. git add lab2.html was used to stage the lab2.html file and git status confirmed this.
  5. Git was configured using git config --global user.name "Leo Riviera" and git config --global user.email "u2014020@dcs.warwick.ac.uk".
  6. A commit was added with a message using git commit -m "Added a new web page".
  7. Using suggestions from the W3C Markup Validation Service website, corrections were made to the code in lab2.html.
  8. After checking the markup, they were recomitted with git commit -m "Improved lab2.html standards compliance".
  9. Using nano lab2.css, a new file was created to hold the CSS classes for custom styling in lab2.html.
  10. nano lab2.html was used to edit the HTML file, to add div tags and a reference to the stylesheet.
  11. The new CSS file was added to Git using git add . and all, the changes were committed using git commit -m "Added styles".

Commands

  • git, which allows the use of Git version control on a project.
  • git init, which creates a new git repo in the current directory.
  • git config, which configures the details that Git has, including name and email.
  • git add, which adds any untracked files to source control.
  • git commit, which commits changes made to version control. The -m flag can be used to commit with a message.