0
0
Gitdevops~10 mins

git add with patterns and directories - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to add all files in the current directory to the staging area.

Git
git add [1]
Drag options to blanks, or click blank then click option'
A-A
B.
C*
D--all
Attempts:
3 left
💡 Hint
Common Mistakes
Using git add -A which is valid but not the simplest here.
Using * which may not work as expected in all shells.
2fill in blank
medium

Complete the command to add all files with the .txt extension in the current directory.

Git
git add [1]
Drag options to blanks, or click blank then click option'
A*.tx
B*.text
C*.txt
D*.doc
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong file extensions like *.text or *.doc.
3fill in blank
hard

Fix the error in the command to add all files inside the src directory.

Git
git add [1]
Drag options to blanks, or click blank then click option'
Asrc/
Bsrc/*
Csrc
Dsrc\
Attempts:
3 left
💡 Hint
Common Mistakes
Using backslash \ which is for Windows paths.
Using src without slash which may work but is less explicit.
4fill in blank
hard

Fill both blanks to add all .js files in the app directory and its subdirectories.

Git
git add [1]/[2]
Drag options to blanks, or click blank then click option'
Aapp
B*.js
C**/*.js
Dapp/**/*.js
Attempts:
3 left
💡 Hint
Common Mistakes
Using app/**/*.js as one token which is invalid here.
Using *.js which matches only files in the top directory.
5fill in blank
hard

Fill all three blanks to add all .css files in the styles directory, excluding files in styles/temp.

Git
git add [1]/[2] && git reset [3]/temp/*.css
Drag options to blanks, or click blank then click option'
Astyles
B**/*.css
Attempts:
3 left
💡 Hint
Common Mistakes
Using different directory names in blanks.
Trying to exclude files with git add only.