Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature/lab4 #1098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Feature/lab4 #1098
Changes from all commits
5663662ed18c32495915d670e7def1362e65795f3c7c99b66e3d782cda4add5File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Lab 2 submission
Task 1. Git Internals, Reflog, and Recovery
1.1 Explore Git Object Plumbing
HEAD commit SHA
Object type of HEAD
Commit object
Tree object
Blob object (.gitignore)
Excerpt:
Interpretation
Git stores repository contents as objects. A commit points to a tree object, which contains references to blobs (file contents) and other trees (directories). Following the chain
HEAD → commit → tree → blobshows how Git reconstructs the working directory from immutable objects.1.2 Looking Inside
.gitTop-level
.gitcontents.git/HEAD.git/refs/headsFirst object directories
Number of loose objects
Interpretation
The
.gitdirectory contains all repository metadata. Theobjectsdirectory stores Git objects addressed by SHA hashes, whilerefsstores branch pointers. TheHEADfile points to the currently checked-out branch.1.3 Disaster Recovery with Reflog
Reflog output
Recovery command
Output:
Git reflog preserved references to commits that were no longer reachable from branch pointers, allowing them to be restored safely.
What if
git gchad run?Git reflog records recent movements of branch references and HEAD. If
git gchad run after the reset and enough time had passed, unreachable commits might eventually have been garbage-collected. In that case, recovery would become much more difficult or even impossible because the underlying objects could be permanently deleted.Task 2. Tag a Release & Rebase a Feature
2.1 Signed Annotated Tag
I created and pushed a signed annotated tag named
v0.1.0-lab2-ByiniyYarik.Tag list
Tag verification
2.2 Rebase + Force-with-Lease
Branch log before rebase
To simulate upstream movement, I created an empty signed commit on local
main:Attempting to push it to
origin/mainfailed because branch protection rules require pull requests:I then rebased
feature/lab2onto the updated localmain.Branch log after rebase
The rebased branch was pushed using:
Merge vs Rebase Reflection
I would choose merge when preserving the exact collaboration history is important, especially on long-lived shared branches. I would choose rebase for my own feature branches before opening a pull request because it keeps history linear and easier to review. Rebasing public branches that other developers already use should generally be avoided.
Bonus Task. Bisect a Real Bug
Git Bisect Log
Offending Commit
Failure Observed
How
git bisectFound the Buggit bisectperforms a binary search through commit history. Instead of checking every commit sequentially, it tests a commit near the middle of the remaining search range and eliminates half of the candidate commits after each result. This process continues until the first bad commit is identified. Because each step halves the search space, the number of required checks grows approximately aslog₂(N), making bisect far more efficient than manually testing every commit.Uh oh!
There was an error while loading. Please reload this page.