Recall & Review
beginner
What does the command
git add . do?It stages all changes (new, modified, deleted files) in the current directory and all its subdirectories for the next commit.
Click to reveal answer
beginner
How can you stage all .txt files in the current directory using
git add?Use the pattern
git add *.txt to stage all files ending with .txt in the current directory only.Click to reveal answer
intermediate
What is the difference between
git add * and git add .?git add * stages all files and directories in the current directory but does not include hidden files or files in subdirectories. <br>git add . stages all changes including hidden files in the current directory and subdirectories.Click to reveal answer
beginner
How do you stage all files inside a specific directory named
docs?Use
git add docs/ to stage all changes inside the docs directory and its subdirectories.Click to reveal answer
intermediate
Can
git add use wildcards to stage files recursively in subdirectories?No, wildcards like
*.txt only match files in the current directory. To stage files recursively, use git add . or specify directories.Click to reveal answer
Which command stages all changes in the current directory and all subdirectories?
✗ Incorrect
git add . stages all changes recursively in the current directory and subdirectories.What does
git add *.js do?✗ Incorrect
The pattern
*.js matches JavaScript files only in the current directory.How to stage all files inside a folder named
src?✗ Incorrect
Using
git add src/ stages all files and folders inside src recursively.Which command does NOT stage hidden files?
✗ Incorrect
git add * does not include hidden files (files starting with a dot).To stage only modified parts of files interactively, which command is used?
✗ Incorrect
git add -p lets you choose parts of files to stage interactively.Explain how to use
git add with patterns to stage specific file types.Think about how shell wildcards work in file names.
You got /3 concepts.
Describe how to stage all changes inside a directory and its subdirectories using
git add.Consider how folders are referenced in commands.
You got /3 concepts.