git add README.md in a repository. What is the immediate output shown by Git?By default, git add does not produce any output when it stages files successfully. It silently updates the staging area.
git add *.txt in a directory with files: notes.txt, todo.txt, and image.png. What files get staged?The shell expands *.txt to all files ending with .txt before Git runs. So only notes.txt and todo.txt are staged.
git add -u stages modified and deleted files but ignores new untracked files. git add -A and git add --all stage all changes including new files.
git add fail with 'fatal: pathspec ... did not match any files'?git add docs/*.md but get the error: 'fatal: pathspec 'docs/*.md' did not match any files'. What is the most likely cause?The error means the shell did not expand the wildcard because no matching files exist. Git received the literal pattern and could not find files matching it.
git add -p lets you review changes chunk by chunk and choose which to stage. Other options stage whole files or all changes.
