- Create a file
$ pwd
/Volumes/ExDrive3/git-repos/local/git-analytics
$ cat first-file.txt
TEST
$
- Check the status
TEST
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# first-file.txt
nothing added to commit but untracked files present (use "git add" to track)
$
- Add the file
$ git add first-file.txt
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: first-file.txt
#
$
- Analyze the difference
$ diff -ur step1 step2
Only in step2/.git: index
Only in step2/.git/objects: 2a
Only in step2: first-file.txt
$ od -t c -t x2 step2/.git/index
0000000 D I R C \0 \0 \0 002 \0 \0 \0 001 O $ 250 257
4944 4352 0000 0200 0000 0100 244f afa8
0000020 \0 \0 \0 \0 O $ 250 257 \0 \0 \0 \0 016 \0 \0 025
0000 0000 244f afa8 0000 0000 000e 1500
0000040 \0 \0 u 316 \0 \0 201 244 \0 \0 001 365 \0 \0 \0 024
0000 ce75 0000 a481 0000 f501 0000 1400
0000060 \0 \0 \0 005 * 002 324 034 342 023 # 261 315 302 ( 307
0000 0500 022a 1cd4 13e2 b123 c2cd c728
0000100 214 354 / 201 300 T 275 4 \0 016 f i r s t -
ec8c 812f 54c0 34bd 0e00 6966 7372 2d74
0000120 f i l e . t x t \0 \0 \0 \0 244 s 350 225
6966 656c 742e 7478 0000 0000 73a4 95e8
0000140 275 247 $ \a 263 231 276 245 ( 307 331 < P 345 230 B
a7bd 0724 99b3 a5be c728 3cd9 e550 4298
0000160
$ ls -aR step2/.git/objects/2a
. .. 02d41ce21323b1cdc228c78cec2f81c054bd34
$ od -t c -t x2 step2/.git/objects/2a/02d41ce21323b1cdc228c78cec2f81c054bd34
0000000 x 001 K 312 311 O R 0 e \b q \r 016 341 002 \0
0178 ca4b 4fc9 3052 0865 0d71 e10e 0002
0000020 027 346 003 ?
e617 3f03
0000024
$
- Memo