Session 2 (9:00a - 9:50a)ΒΆ

Committing code

Files being bumped out of stage (editing a file once it’s staged)? Not really. What really happens? Why is the file shown in unstaged and staged? There are two sets of changes. Two scopes, file and content. Git separates them in to two sets of changes – to see the difference:

git diff

compare to

git diff --staged

to see what’s going on.

git commit -v

Interatcive add:

``git add -p``

Filtered Diff:

``git diff -diff-filter=M``

A = Added C = Copied D = Deleted M = Modified R = Renamed T = Type changed U = Unmerged X = Unknown B = Broken pairing

Normal git diff – highlights whitespace changes.

git diff -w – surpresses whitespace changes.

git diff --color-words HEAD

git add -A – adds any new files whereas git add . will just add modified.