0
0
Gitdevops~5 mins

.gitconfig file structure - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the .gitconfig file?
The .gitconfig file stores configuration settings for Git, such as user info, aliases, and behavior preferences.
Click to reveal answer
beginner
How are sections defined in a .gitconfig file?
Sections are defined using square brackets, like [section]. For example, [user] groups user-related settings.
Click to reveal answer
beginner
What is the syntax to set the user email in .gitconfig?
Inside the [user] section, use email = your.email@example.com to set the user email.
Click to reveal answer
intermediate
How can you define a command alias in .gitconfig?
Use the [alias] section and add lines like co = checkout to create shortcuts for Git commands.
Click to reveal answer
intermediate
What is the difference between system, global, and local .gitconfig files?
System config applies to all users on the machine, global config applies to the current user, and local config applies to a specific repository.
Click to reveal answer
Which symbol is used to define a section in a .gitconfig file?
ACurly braces {}
BSquare brackets []
CParentheses ()
DAngle brackets <>
Where is the global .gitconfig file usually located?
AIn the repository's root folder
BIn the system's /etc folder
CIn the Git installation folder
DIn the user's home directory
How do you set your Git username in the .gitconfig file?
A[user] name = YourName
B[user] username = YourName
C[username] name = YourName
D[user] user = YourName
What section would you use to create a shortcut for the Git command checkout?
A[alias]
B[commands]
C[shortcuts]
D[user]
Which .gitconfig file has the highest priority when Git reads configurations?
ASystem config
BGlobal config
CLocal config
DDefault config
Describe the structure of a .gitconfig file and how to set user information.
Think about how you organize settings in groups and assign values.
You got /4 concepts.
    Explain the difference between system, global, and local .gitconfig files and when each is used.
    Consider who and what each config affects.
    You got /4 concepts.