Git tracks files by initializing a project using git init, creating a .git folder that stores project history.Staging files for tracking involves moving them to the Staging Area using git add command.Key components of the .git folder include the index, objects, and HEAD, pointing to branches or commits.Commits in Git are snapshots of code at a specific time, each generating a unique hash ID.Git compares changes using metadata inside .git and stores content in blobs, trees, and commits.The commit hash allows users to view commit details and contents in files.Git stores commits uniquely with SHA-1 hashes based on content, previous commits, and metadata.Git allows traveling between commits, comparing differences, and moving HEAD to a previous commit.GitHub is a remote repository platform enabling collaboration and sharing code changes.Developers can push local changes to GitHub repositories using git push commands.