Skip to content

Instantly share code, notes, and snippets.

@dirkdunn
Created February 28, 2017 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dirkdunn/959807e5a26520ad9f31a686774baf41 to your computer and use it in GitHub Desktop.
Save dirkdunn/959807e5a26520ad9f31a686774baf41 to your computer and use it in GitHub Desktop.
Git practice activity

Git Practice

15 min

  1. Initialize a new directory in your workspace
  • Navigate to your WDI code directory and create a new folder mkdir [directory name]
  • Change into your new directory cd [directory name]
  • Use git init to initialize a new Git repository
  1. Create 3 new files
  • Use touch [filename]
  1. Check the status of your Git repository
  • Use git status
  • Note that the three files you've added are marked as untracked because you haven't added them to Git yet
  1. Start tracking these files by adding them to Git
  • Use git add [filename] for all the files you created
  • Check the status of your git repository now by using git status
  • Note that the files are now marked as new file
  1. Commit your changes
  • Use git commit -m "[Brief description of the changes made]"
  1. Edit a couple of your files with some new content
  • Check the status of the repository with git status
  • Notice that your files are now marked as modified
  1. Commit your new changes
  • Use git commit -m "[Brief description of the changes made]"
  1. View the history of commits
  • Use git log to view the history of commits made
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment