Skip to content

Instantly share code, notes, and snippets.

@rogerwschmidt
Last active June 7, 2017 15:29
Show Gist options
  • Save rogerwschmidt/61f000b37eacea3f1f2c4ae1fc308dd0 to your computer and use it in GitHub Desktop.
Save rogerwschmidt/61f000b37eacea3f1f2c4ae1fc308dd0 to your computer and use it in GitHub Desktop.

Intro to Git Instructor notes

Objectives

  • Explain what a version control system is.
  • Explain why a version control system is important.
  • Explain what Git is.
  • Initialize a Git repository.
  • Add and commit changes to a Git repository.
  • Explain what GitHub is.
  • Push commits from a local repository to a remote repository.

What is a version control system?

Turn to your neighbor and explain what a version control system is. Be prepared to share your discussing with the class.

Why is version control system important?

Turn to your neighbor and explain why a version control system is important. Be prepared to share your discussion with the class.

What is Git?

Turn to your neighbor and explain what Git is.

How do you initialize a Git repository

Write down the command to initialize a git repository. Be prepared to share with the class

Add and commit changes to a Git repository.

  1. Write down the command to add changes to staging. Be prepared share your answer with the class
  2. Write down the command commit (create a new revision) your changes. Be prepared to share your answer with the class.

Explain what GitHub is.

Turn your neighbor and expalin what Github is. Be prepared to share with the class.

Push commits from a local repository to a remote repository.

Create a new repository in Github

  1. In github.com, create a new repository, make sure you initialize it with a readme.
  2. Clone your new repository to your computer
  3. Open the folder that you cloned in atom.
  4. Change the contents of the readme file. It does not matter what you changes, as long as it is different.
  5. Add your changes to the staging area.
  6. Commit your changes to a new revision
  7. Push your changes to github.com
  8. In github.com, go look at the file you change in your repository. Make sure that you click on the README.md file.
  9. Click the commits link at the top of the text area, what do you see?

Create a repository on your computer first, that create a Github repository

  1. In your computer, create a new folder named superProject
  2. Change directories into your new folder
  3. Initialize a new git repository.
  4. Create a new file named README.md
  5. Insert some text into README.md
  6. Add your changes to the staging area
  7. Commit your changes to a new revision
  8. Go to github.com
  9. Create a new repository name superProject, make sure that you do not initialize it with a README.md
  10. After creating an empty repository, you'll get directions on how to associate your repository on your computer to the github repository. It will look as follows (Note: This is what I got, your text will be different):
git remote add origin https://github.com/rogerwschmidt/superProject.git
git push -u origin master

The first command adds a remote (In this case, github) to the local repository. The second command associates my local master branch, with the remotes' master branch

  1. Run both commands in your terminal. Make sure that you run the commands from the folder in which your git repository was initialized.
  2. Go back to Github.com to see your changes.

Bonus Objective 1: How do you delete a repository in Github?

With your neigbor, investigate how to delete a repository from github.

Bonus Objective 2: How do you delete a repository from your local machine?

With your neighbor, investigate how to delete a repository from your local machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment