FlashKeepers

Git and Version Control · College · College and University

Git I: Basics and Commits

Git init, add, commit, status, log, diff, gitignore, the staging area, and the three trees model.

About this set

40 basic cards for College Git and Version Control. Set 1 of 4 in Git. It opens with "What does `git init` do?" and "Where is Git's configuration and history stored after running `git init`?". Study it alongside the other College sets below.

40 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What does `git init` do?
Show answerCreates a new Git repository in the current directory
Where is Git's configuration and history stored after running `git init`?
Show answerIn a hidden `.git` directory
What is the difference between the working directory and the staging area?
Show answerThe working directory contains all current files, while the staging area contains only changes marked for the next commit
Why use a staging area instead of committing changes directly?
Show answerIt allows you to choose which specific changes to include in each commit
What does `git add <file>` do?
Show answerStages the specified file for the next commit
How do you stage all changes in the current directory at once?
Show answerUse `git add .` or `git add -A`
What does `git commit` do?
Show answerCreates a snapshot of the staged changes with an author, timestamp, and message
What is the purpose of the -m flag in `git commit -m "message"`?
Show answerAllows you to write the commit message inline without opening an editor
What happens to the staging area after you run `git commit`?
Show answerIt is cleared, ready for the next set of changes
How do you modify the last commit without creating a new one?
Show answerUse `git commit --amend`
What does `git status` show?
Show answerThe status of files in the working directory and staging area, indicating what is changed, staged, or untracked
What are untracked files?
Show answerFiles in the working directory that Git has never seen before and has not been told to track
What are modified files in Git?
Show answerFiles that exist in the repository but have been changed since the last commit
What does `git log` display?
Show answerA history of all commits in reverse chronological order (newest first)
How do you view each commit on a single line in `git log`?
Show answerUse `git log --oneline`

25 more cards in the app

Study this set free