Written by
Aaron Bell
on
on
Git tracking differs from staging
I learned some Git principles and judo:
- tracking differs from staging:
- i.e.
git commit -a
stages and commits already-tracked files, and new files won’t be committed; - git add . tracks and stages.
- by definition, files are tracked only when they are first staged/committed. There is no “track but not stage” for new files
- i.e.
git diff
is “staged - working directory”. git diff –staged is “commit - staged”.git status -s
gives a concise description of what’s untracked, modified, and whether the modification is staged or not.- the “/[name]” ignores things in the current directory.
- “[name]” ignores things of a given name in all directories… more powerful than expected