Objectives

The goal of this module are to:

  • Set up the accounts you will need to write and submit code
  • Learn the basics of HTML and CSS
  • Learn how PHP works

Deadline: this needs to be finished by the end of lab

1. Creating GitHub account

GitHub is a service for storing and sharing code repositories. You will use it to submit your some of your assignments, but it will be mostly used for teams projects in this class. If you already have a GitHub account, you do not need to create a new one especially for this class.

  • Go to https://github.com/ and enter your info to “Sign up for GitHub”.
  • Choose the free plan

If you have not completed this survey, please do so now.

2. Git Web Interface

Setup your assignment repository here: https://classroom.github.com/a/RGIeemlx

This will create a copy of the repository for your GitHub account.

  • Click the link to view your version of the repository
  • Be sure that it lists your github username in the repository name!

3. Linux and the Git Command Line Interface

Most of the time we will NOT be writing files directly in the Github web interface. Instead, you will clone a copy of the files to your computer, edit files and commit your changes locally, and finally push your modified files back to the GitHub site to share with others (like the instructor/TAs).

We will practice doing this on a Unix machine in SEAS: gwupyterhub.seas.gwu.edu server. This requires us to learn a little bit about Linux.

  • See this page on instructions on how to connect to the server.
  • Once the connection is established it will open a page showing some basic information about the computer that you are connected to.

Command Line Basics

  • This will open a terminal with a Command Line where you can issue commands to your own personal Linux server. It should start with something like:
Last login: Tue Jan 15 11:53:05 2019 from 161.253.125.71
roxana@gwupyterhub:~$

This indicates when you last logged onto the server (Tue Jan 15 11:53:05 2019), from what IP address (161.253.125.71).


Command Line Git

Git is a distributed version control system. Learn more!

Simply put, this means that the files in a Git repository can be worked on by multiple people at the same time. This is great for companies with many developers working on a shared code base. However, it is useful even for one person – Git lets you coordinate and synchronize files across multiple computers. For example, if you use a laptop at home, a desktop at your parents’ house, and a different computer in the lab, Git can help you keep your files up to date on all of them.

Lab 1.3: Follow the instructions below to complete this exercise.

To be able to work with the files in a Git repository, you need to clone a copy of it. To do that, we need to know the unique URL for the repository.

  • Browse to the root of your Lab 1 repository on the GitHub website. Click the green Clone or Download button on the right side of the screen and copy the URL. You should get something like: https://github.com/GWU-CSCI2113/lab1-essentials-YOUR_ID.git
  • In your MobaXterm Terminal, run the following command, filling in your URL:
    git clone REPO_URL
    

    You are going to be asked for your GitHub account credentials:

    Cloning into 'lab1-essentials-YOUR_ID'...
    Username for 'https://github.com': YOUR_ID
    Password for 'https://YOUR_ID@github.com':
    
  • Congratulations! You have now completed the lab. Verify that the version on the GitHub website has all of the correct content and you are done!

What did we learn?

  • How to work with Markdown files in the GitHub web interface.
  • How to navigate through folders in a terminal and read/write files.
  • How to redirect output from a command into a new file, or to append to a file.
  • How to clone a copy of a git repository, modify files, and push our commits back to the GitHub web site.

Linux Troubleshooting and Tips

There are many great resources online to help you learn the Linux command line. You will find that is a very powerful tool, and many programmers prefer it to interacting with folders on your desktop. There are similar terminal programs on OS X and Windows - try one out!

Here is one (of many) great tutorials on using the Linux Command line.