CS FundamentalsHardProduct-company placement · Git interview
On main you need the version of config.yml that exists on branch release, without merging anything else. Which command does this, and what state does it leave?
- A. git checkout release -- config.yml; the file is replaced in the working tree and staged, ready to commit on main
- B. git merge release config.yml; it creates a merge commit
- C. git cherry-pick release config.yml; it copies one commit
- D. git pull release config.yml; it fetches the file
Correct answer: A. git checkout release -- config.yml; the file is replaced in the working tree and staged, ready to commit on main
Giving a branch and a path checks out that path's content from the branch into both the index and the working tree (git restore --source=release --staged --worktree config.yml is the newer equivalent). Nothing else changes.
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
- A file was renamed from util.js to helpers.js three months ago. git log helpers.js shows only the commits since the rename. Which command…
- Branches deleted on the remote still appear in git branch -r on a developer's machine. Which command removes these stale remote-tracking…
- On a cumulative flow diagram for a Kanban board, the band for 'In Review' keeps getting wider over several weeks while the 'Done' line…
- A customer requests a feature on 1 March; the team starts work on it on 10 March and delivers it on 15 March. Using common Kanban…
- According to the 2020 Scrum Guide, how many of these are true? 1. An Increment may be delivered to stakeholders before the end of the…
- A fragment contains total = 0 immediately followed by total = compute(), with no use of total in between, and later print(rate) where rate…