CS FundamentalsModerateWipro · Accenture pattern
You are halfway through a change when an urgent bug needs fixing on the same branch. Which command shelves your uncommitted changes so the working tree is clean, letting you re-apply them later?
- A. git reset --hard
- B. git stash
- C. git checkout -- .
- D. git commit --amend
Correct answer: B. git stash
git stash saves tracked modifications (and staged changes) to a stack and reverts the working tree; git stash pop brings them back. reset --hard and checkout -- . would throw the work away.
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 Dockerfile ends with CMD ["python", "app.py"]. The container is started with docker run myimage python test.py. What runs?
- Which practice is the defining feature of Kanban rather than Scrum?
- Java's I/O library lets you write new BufferedReader(new InputStreamReader(socket.getInputStream())), each wrapper adding behaviour to the…
- An age field accepts integers from 18 to 60 inclusive. Using equivalence partitioning only, what is the minimum number of test values…
- Counting each simple condition in a compound boolean expression as a separate decision, what is the cyclomatic complexity of this…
- A program's control flow graph has two separate connected components (for example, main and one called function drawn separately), with 14…