Bird
0
0

How do you correctly create a local Git alias named lg for the command log --oneline --graph?

easy📝 Syntax Q3 of 15
Git - Configuration and Aliases
How do you correctly create a local Git alias named lg for the command log --oneline --graph?
Agit config alias.lg log --oneline --graph
Bgit config --global alias.lg log --oneline --graph
Cgit config alias.lg 'log --oneline --graph'
Dgit alias lg='log --oneline --graph'
Step-by-Step Solution
Solution:
  1. Step 1: Local alias creation

    Local aliases omit the --global flag.
  2. Step 2: Proper quoting

    Commands with multiple options must be quoted to be treated as a single string.
  3. Final Answer:

    git config alias.lg 'log --oneline --graph' -> Option C
  4. Quick Check:

    Local alias + quotes [OK]
Quick Trick: Local aliases omit --global and require quotes [OK]
Common Mistakes:
  • Using --global when creating local aliases
  • Not quoting multi-option commands
  • Using incorrect git alias syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes