CS FundamentalsVery hardProduct-company placement · Git interview

You run git stash pop and it reports a merge conflict in f.txt. What happens to the stash entry?

  1. A. It is dropped as usual, so the conflicting changes can be lost
  2. B. It is kept in the stash list, so you can resolve the conflict (or reset and retry) and then drop it manually
  3. C. It is converted into a commit
  4. D. It is moved to a new branch automatically

Correct answer: B. It is kept in the stash list, so you can resolve the conflict (or reset and retry) and then drop it manually

When applying fails with conflicts, git stash pop does not remove the entry ('The stash entry is kept in case you need it again'). After resolving, run git stash drop yourself.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic