of changesets, but as a series of snapshots. • commit - Git stores a commit object that contains a pointer to the snapshot of the content you staged, author and message, and zero or more pointers to the commit or commits that were direct parents of this commit.
3 files. You stage them all and commit. • Staging - checksums each one, stores that version of the file in git repository (referred to in git as blobs), and adds checksum to staging area $ git add README test.rb LICENSE! $ git commit -m 'initial commit of my project'
stores them as tree objects in the git repository. • Git creates commit object with pointer to the root project tree object so it can re-create that snapshot when needed.
• a blob or the contents of each file • a tree listing contents of the directory. • one commit with the pointer to that root tree and all the commit metadata
one of these commits. • Default branch is named ‘master’. • As you make commits master points to the last commit you made. • Moves forward automatically every time you commit.
commit on testing… • The HEAD pointer moves forward with each commit. • master branch still points to the commit we were on before we switched branches.
that contains the 40 character checksum of the commit it points to. • This makes branches cheap to create and destroy. • It’s as simple as writing 41 bytes to a file (40 characters and a newline) • Other VCS’ can be much slower and involve copying project files, whereas git is instantaneous. • So use branches!!!
feature. • Make sure unstable code is never committed to the main code base. • Allows you to clean up your features history before merging into main branch.