Week 2 – Using Git Locally

introduction to git and github week 2

Practice Quiz: Advanced Git Interaction

1. Which of the following commands is NOT an example of a method for comparing or reviewing the changes made to a file?

  • git log -p
  • git diff –staged
  • git add -p
  • git mv

2. What is the gitignore file?

  • A file containing a list of commands that Git will ignore.
  • A file the user is intended to ignore.
  • A file listing uncommitted changes.
  • A file containing a list of files or filename patterns for Git to skip for the current repo.

3. What kind of file will the command git commit -a not commit?

  • Tracked files
  • New files
  • Old files
  • Staged files

4. What does HEAD represent in Git?

  • The subject line of a commit message
  • The top portion of a commit
  • The currently checked-out snapshot of your project
  • The first commit of your project

5. If we want to show some stats about the changes in a commit, like which files were changed and how many lines were added or removed, what flag should we add to git log?

  • –stat
  • –patch
  • -2
  • –pretty

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply