Git - StashingYou want to stash changes with a name and include untracked files, but exclude ignored files. Which command is correct?Agit stash push -m "update" -uBgit stash push -m "update" -aCgit stash push -m "update" --exclude-untrackedDgit stash push -m "update" --no-ignoredCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand flags for untracked and ignored files-u includes untracked files but excludes ignored files; -a includes both untracked and ignored.Step 2: Choose correct commandgit stash push -m "update" -u uses -u to include untracked only, matching the requirement.Final Answer:git stash push -m "update" -u -> Option AQuick Check:-u includes untracked, excludes ignored [OK]Quick Trick: -u includes untracked files, -a includes ignored too [OK]Common Mistakes:Using -a when ignored files should be excludedUsing non-existent flags like --no-ignoredConfusing --include-untracked with -u
Master "Stashing" in Git9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Git Quizzes Cherry-Pick and Advanced Merging - Octopus merge for multiple branches - Quiz 9hard Cherry-Pick and Advanced Merging - Why cherry-pick is useful - Quiz 7medium Collaboration Workflows - Pull request process - Quiz 7medium Rebasing - Squashing commits - Quiz 12easy Rebasing - Rebase vs merge mental model - Quiz 1easy Remote Repositories - git fetch to download without merging - Quiz 11easy Remote Repositories - git pull to download and merge - Quiz 12easy Stashing - git stash pop to restore - Quiz 6medium Stashing - Dropping and clearing stashes - Quiz 15hard Tagging - Tagging specific commits - Quiz 12easy