Github and Website Workshop/git-commit-changes

From OpenHatch wiki
Revision as of 03:59, 19 February 2015 by imported>Auria (Created page with "Welcome to the the fourth step of the [https://openhatch.org/wiki/Github_and_Website_Workshop Github and Website Workshop] - using git to keep track of your changes and update...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Welcome to the the fourth step of the Github and Website Workshop - using git to keep track of your changes and update your online website!

Recall: Git is a revision control system, a tool to manage the history of your code (the tool we are learning to use in the terminal today)

Let's take a look at the history of the code we've written so far!

Open git shell and navigate to the folder with your project (if it isn't already open). Recall the following commands:

  • pwd: prints the current file path e.g. Documents/CS/
  • ls: prints the contents of the current folder
  • cd [folder]: enters the folder

Add files and commit

Read about the following commands on http://gitref.org/basic/

  • git add
  • git status
  • git diff
  • git commit
  • (We will discuss the other commands later)

Enter the commands from this tutorial as you go, but use file names from your own repository.

By the end of this activity you should have committed all your files, and running git status should give the message that your working directory is clean (no new changes).

If you ever want to review git commands and what they do, check out this reference sheet