0
0
Gitdevops~5 mins

Untracked vs tracked files in Git - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What is a tracked file in Git?
A tracked file is a file that Git knows about and is monitoring for changes. It has been added to the repository at some point, usually with git add, and is part of the version history.
Click to reveal answer
beginner
What does it mean when a file is untracked in Git?
An untracked file is a file in your working directory that Git does not know about yet. It has not been added to the repository, so Git does not monitor it until you tell it to track the file.
Click to reveal answer
beginner
How can you see which files are tracked or untracked in your Git repository?
You can run git status. It shows tracked files with changes and lists untracked files separately under "Untracked files".
Click to reveal answer
beginner
How do you start tracking an untracked file?
Use the command git add <filename>. This stages the file and tells Git to track it in the next commit.
Click to reveal answer
beginner
What happens if you modify a tracked file?
Git notices the change and marks the file as modified. You can then stage the changes with git add and commit them to save the new version.
Click to reveal answer
Which command shows untracked files in your Git repository?
Agit commit
Bgit clone
Cgit push
Dgit status
What does it mean if a file is listed under "Untracked files" in git status?
AThe file is new and not yet added to Git
BThe file is deleted
CThe file is committed
DThe file is ignored by Git
How do you start tracking a new file in Git?
Agit clone &lt;filename&gt;
Bgit commit &lt;filename&gt;
Cgit add &lt;filename&gt;
Dgit push &lt;filename&gt;
If you modify a tracked file, what is the next step to save changes in Git?
Agit add &lt;filename&gt;
Bgit clone
Cgit status
Dgit init
Which of these files will Git not track by default?
ATracked files
BUntracked files not added
CFiles staged with git add
DCommitted files
Explain the difference between tracked and untracked files in Git.
Think about what Git knows and monitors in your project.
You got /4 concepts.
    Describe the steps to start tracking a new file and save its changes in Git.
    Consider the commands to add and commit files.
    You got /3 concepts.