What does the git stash drop command do?

What does the git stash drop command do?

a) Deletes the latest stash
b) Applies the latest stash
c) Lists all stashes
d) Commits the latest stash

Answer:

a) Deletes the latest stash

Explanation:

The git stash drop command deletes the latest stash from the stash list. This is useful when you no longer need a stash and want to remove it to keep the stash list clean.

For example, running git stash drop will remove the most recent stash, while specifying a stash with its identifier (e.g., git stash drop stash@{1}) will remove a specific stash.

Keeping your stash list organized is essential for managing multiple sets of saved changes effectively.

Reference:

Top 100 Git and GitHub MCQ Questions and Answers

Scroll to Top