A tracked text file, notes.txt, contains 60 distinct lines in the current commit, identified by HEAD. Initially, its staged and working versions match that commit.
You make these changes in order:
All original and added lines have unique text. Surviving lines keep their relative order, every line ends with a newline, and there are no other edits, renames, filters or special diff settings. No commit is made.
The --numstat option reports inserted and deleted line counts separately. Determine both counts for git diff --numstat -- notes.txt and both counts for git diff --numstat HEAD -- notes.txt, after all the changes above. Give each answer as an exact integer number of lines.
Unlock full course notes by signing up
Counting files in each git status section
A repository contains two tracked files, a.txt and b.txt, and the working tree matches the last commit exactly. You carry out the steps below in order. After each step, enter how many files git status would list under Changes to be committed (Staged), under Changes not staged for commit (Not staged), and under Untracked files (Untracked).
Keep a generated file locally while stopping tracking
A generated file named debug.log is already tracked and committed. Your working tree and staging area have no pending changes. You want future commits to omit this file while keeping its local copy on disk. Complete the procedure using the long command option and the standard project ignore filename.
Run git rm ________ -- debug.log from the project root.
Add a line containing /debug.log to the project-root file named ________.
Commits in the log after amend and revert
In a repository whose working tree is clean, git log --oneline lists 14 commits. You then do the following, in order:
Edit app.js, stage it with git add, and run git commit.
Immediately run git commit again with a new message, without editing or staging anything.