0
0
Gitdevops~5 mins

Working directory state in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the working directory in Git?
The working directory is the folder on your computer where you edit and create files. It shows the current state of your project files before you save changes to Git.
Click to reveal answer
beginner
What does it mean if a file is modified in the working directory?
A modified file means you changed it in your working directory but have not yet saved those changes to Git with a commit.
Click to reveal answer
beginner
How can you see the state of your working directory in Git?
Use the command git status. It shows which files are modified, staged, or untracked in your working directory.
Click to reveal answer
intermediate
What is the difference between the working directory and the staging area?
The working directory is where you edit files. The staging area is where you prepare files to be saved in the next commit.
Click to reveal answer
intermediate
What happens if you run git checkout -- <file> on a modified file in the working directory?
It discards changes in the working directory for that file, restoring it to the last committed version.
Click to reveal answer
What does the working directory in Git represent?
AThe remote repository on GitHub
BThe saved commit history
CThe list of branches
DThe current files you are editing on your computer
Which command shows the state of your working directory?
Agit status
Bgit commit
Cgit push
Dgit branch
If a file is modified in the working directory, what does that mean?
AThe file is unchanged
BThe file has changes not yet saved to Git
CThe file is deleted from the project
DThe file is staged for commit
What does the command git checkout -- <file> do to a modified file?
ASaves changes to the remote repository
BAdds the file to the staging area
CDiscards changes and restores the last committed version
DDeletes the file permanently
Which area holds files you want to include in the next commit?
AStaging area
BWorking directory
CRemote repository
DCommit history
Explain the role of the working directory in Git and how it relates to the staging area and commits.
Think about the flow of changes from editing to saving in Git.
You got /3 concepts.
    Describe how you can check the state of your working directory and what information you get from it.
    This command helps you know what files need attention.
    You got /3 concepts.