Bird
0
0

You want to create an alias unstage that runs reset HEAD -- to unstage files. Which command correctly creates this alias?

hard📝 Workflow Q9 of 15
Git - Configuration and Aliases
You want to create an alias unstage that runs reset HEAD -- to unstage files. Which command correctly creates this alias?
Agit alias --global unstage 'reset HEAD --'
Bgit config --global alias.unstage reset HEAD --
Cgit config alias.unstage 'reset HEAD --'
Dgit config --global alias.unstage 'reset HEAD --'
Step-by-Step Solution
Solution:
  1. Step 1: Determine alias scope

    Global alias requires --global flag.
  2. Step 2: Quote multi-word command

    Command with spaces must be quoted to be treated as one string.
  3. Step 3: Check options

    git config --global alias.unstage 'reset HEAD --' uses --global, alias prefix, and quotes the command correctly.
  4. Final Answer:

    git config --global alias.unstage 'reset HEAD --' -> Option D
  5. Quick Check:

    Global alias with multi-word command needs quotes [OK]
Quick Trick: Quote multi-word commands when creating global aliases [OK]
Common Mistakes:
  • Not quoting commands with spaces
  • Using local alias when global needed
  • Using invalid 'git alias' command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes