Git show: reading an old file without switching branches
git show can display contents from a repository object. For example, git show HEAD:README.md reads that file from the current commit without editing the working copy.
Software, devices and technical concepts, explained clearly.
git show can display contents from a repository object. For example, git show HEAD:README.md reads that file from the current commit without editing the working copy.
git stash stores selected local changes so the working tree can be used for another task. Untracked files are not included by default as they are with explicit --include-untracked.
git status distinguishes working-tree changes against the index, staged changes against HEAD and untracked files. These are different states, not one automatic publication list.
git switch -c feature creates and selects a new branch. Plain git switch feature normally selects an existing branch.
An annotated tag is a separate Git object with a message and metadata. A lightweight tag is a simpler reference. Both can identify a version, but they are different representations.
git worktree supports multiple working trees attached to one repository. It helps check a fix without replacing the files of the current task.
glob finds paths matching patterns such as *.csv, but does not guarantee their order. Sort the results explicitly for an ordered import.
gzip.open() can provide text mode with an explicit encoding. Compressed text can then be read sequentially without first writing a complete uncompressed file.
hashlib.sha256(b'abc').hexdigest() returns a hexadecimal digest of the supplied bytes. Successive update() calls process chunks of the same stream.
heapq maintains a min-heap with the smallest item at the front. heappush() adds a value and heappop() retrieves the smallest while preserving the structure.
HMAC combines a message, a secret key and a chosen hash algorithm. A recipient holding the same key can calculate the expected code and compare it with hmac.compare_digest().
The HTTP cache stores responses that can be reused. Understanding Cache-Control and ETag helps distinguish between fast loading, change checking, and custom content protection.