Skip to content

Instantly share code, notes, and snippets.

@Shurlow
Last active February 12, 2020 04:32
Show Gist options
  • Select an option

  • Save Shurlow/c4c5639b58866e19d47ee56cda92e75c to your computer and use it in GitHub Desktop.

Select an option

Save Shurlow/c4c5639b58866e19d47ee56cda92e75c to your computer and use it in GitHub Desktop.
Git & Github Lesson Notes

Git and Github

Objectives

  • Explain what Git is
  • Use Git to manage a local repository

Practice

Lets go through this list of steps together. As we work through each step, take notes about the commands used.

  1. Create a new directory called 'things'. cd into that directory.
  2. Initialize a git repository.
  3. Create a new text file with the name of your favorite <thing>. Example: touch pizza.txt
  4. Check the status of your repo to confirm that your new file exists and has not yet been added to your repo.
  5. Add the new file to your staging area.
  6. Commit the new file to you repo with the message "added [filename].txt to the repo"
  7. Open the file in your text editor and write a short sentance about yout chosen <thing>.
  8. Check the status of your repo to see your changes.
  9. Add your changes to the staging area.
  10. Check the status to confirm that your changes have been added to the staging area.
  11. Commit the changes to your repository with the message "added first line"
  12. Repeat the previous steps (3-11), adding a second <thing> to the file.
  13. Commit these lines one at a time.
  14. Run the fancy git log command (git log --oneline --graph --decorate --all) to see your commit history. You should see your 5 commits have been added to the graph. Congrats! You've used the git add and git commit commands to add and track changes to your project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment