Three small tools you will use every day: git diff, git restore, and .gitignore.
git diff shows the exact lines you changed since the last add or commit. Lines starting with - were removed, + were added.
A file called .gitignore lists things Git should never track: secrets, build output, huge folders. A line starting with ! makes an exception. Edit the rules and watch which files are ignored.
.gitignore only affects files Git is not tracking yet. If a file was already committed, Git keeps tracking it and keeps showing its changes. Add the rule before the first commit, or stop tracking with git rm --cached file. If a secret was already committed, ignoring it is not enough: treat it as leaked (Part 3 covers this). You will try it in the practice below.error: pathspec 'todo.txt' did not match any file(s) known to gitGit has never seen that fileCheck the spelling with ls. If the file is new, use git add first.The following paths are ignored by one of your .gitignore filesA rule is hiding that fileFix the rule, or add -f if you truly want it tracked.(empty output from git diff)Nothing to show, or it is stagedgit diff only shows unstaged changes. Try git diff --staged.Make a change, look at it, then throw it away safely.