CS FundamentalsHardCognizant GenC · HCL
A developer checks out a specific commit by its hash and makes two new commits, then switches to main without creating a branch. What is the risk?
- A. They are automatically merged into main
- B. The two commits become unreachable from any branch and may be garbage collected
- C. They are deleted immediately and cannot be recovered even via reflog
- D. They are copied to the remote repository
Correct answer: B. The two commits become unreachable from any branch and may be garbage collected
In detached HEAD state commits belong to no branch; once HEAD leaves they are only reachable via reflog until pruned.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- In Basic COCOMO (organic mode, Effort = 2.4 x (KLOC)^1.05 person-months), what is the approximate effort for a 10 KLOC project?
- A task has optimistic 4 days, most likely 6 days and pessimistic 14 days. What is the PERT expected duration?
- Which deployment strategy releases a new version to a small subset of users first and widens the rollout gradually while monitoring?
- Why is it advised not to run git rebase on commits already pushed to a shared branch?
- A module of 30,000 lines of code has 45 defects found in testing. What is the defect density?
- Under the cloud shared responsibility model for IaaS (for example virtual machines), which task is the customer's responsibility?