Recall & Review
beginner
What is a Git alias?
A Git alias is a shortcut name for a longer Git command or series of commands. It helps you run common commands faster by typing a short word instead of the full command.
Click to reveal answer
beginner
How do you create a Git alias for the command
git status?You run
git config --global alias.st status. Now, typing git st will show the status.Click to reveal answer
intermediate
Where are Git aliases stored when created with
--global?They are stored in the global Git configuration file, usually located at
~/.gitconfig.Click to reveal answer
intermediate
How can you list all Git aliases you have set?
Run
git config --get-regexp alias to see all aliases and their commands.Click to reveal answer
advanced
Can Git aliases include multiple commands or shell commands?
Yes, by prefixing the alias command with an exclamation mark
!, you can run shell commands or multiple commands in one alias.Click to reveal answer
Which command creates a Git alias named
co for checkout?✗ Incorrect
The correct syntax is
git config --global alias.co checkout to create a global alias.After creating an alias
st for status, how do you use it?✗ Incorrect
You simply run
git st to use the alias for git status.Where does Git store aliases created without the
--global flag?✗ Incorrect
Without
--global, aliases are stored in the local Git config file inside the current repository.How do you create a Git alias that runs a shell command?
✗ Incorrect
Prefixing the command with
! tells Git to run it as a shell command.What command lists all Git aliases you have set?
✗ Incorrect
Use
git config --get-regexp alias to list all aliases.Explain how to create and use a Git alias for a common command like
git status.Think about how to shorten commands you use often.
You got /3 concepts.
Describe how Git aliases can run shell commands and why that might be useful.
Consider how to extend Git commands beyond built-in ones.
You got /3 concepts.