Git Version, Help, and Configuration
Verify Git, use Git’s built-in help, and configure repository-local identity without changing global settings.
Basic
Identify the Git executable
Before learning repository operations, establish which Git executable is actually running. Git provides `git --version` and `git version` for displaying version information. Foxipa verifies command behavior with a real Git executable, so version output is part of the verification record.
git --version
git versionThe two forms are equivalent entry points for displaying Git version information. The exact version string depends on the Git installation, so do not memorize a particular number as the meaning of the command.
Quick check
Which command is intended to display the installed Git version?
git --versiongit version
Use Git help as part of the tool
Git ships its own command help system. `git help` shows the common-command synopsis; `git help -a` lists available commands; and `git help <command>` requests documentation for a specific command. `git <command> --help` is another way to request that command help.
git help
git help -a
git help --guides
git help --configHelp output can depend on the local installation and documentation viewer. For automated verification, Foxipa checks that Git accepts the documented help forms and returns the expected command information without requiring a graphical browser or a particular pager.
Quick check
What does `git help -a` ask Git to display?
git help -agit help -a
Understand configuration scope
Git configuration is layered. A repository can have its own local configuration, while user-level and system-level configuration can provide fallback values. For curriculum laboratories, use repository-local configuration so tests do not depend on a learner’s personal machine settings.
git config --local user.name "Foxipa Learner"
git config --local user.email "learner@example.invalid"
git config --local --get user.name
git config --local --get user.emailThe `--local` option targets the repository configuration. The values are stored with that repository and can be inspected without modifying the learner’s global Git configuration.
Quick check
Why does this lesson use `git config --local` for the practice repository?
git init -b maingit config --local user.name "Foxipa Learner"
Set and read a repository identity
Commits record author and committer information. Configure a deterministic practice identity in the disposable repository before creating commits.
git config --local user.name "Foxipa Learner"
git config --local user.email "learner@example.invalid"
git config --local --get user.name
git config --local --get user.emailThe email address above uses the reserved `.invalid` domain because it is a laboratory value, not a real contact address. The important lesson is the configuration mechanism and scope, not the particular identity text.
Quick check
Which command reads the repository-local `user.name` value?
git config --local user.name "Foxipa Learner"git config --local --get user.name
Inspect configuration provenance
When debugging configuration, knowing only the value is not always enough. Git can show where configuration came from. `--show-origin` adds the source of each displayed configuration value.
git config --local --list --show-originThis command is especially useful when a value appears to come from somewhere unexpected. The exact file path is environment-dependent, so the lesson tests the property that the repository-local configuration source is identified rather than hard-coding a machine-specific path.
Quick check
What does `--show-origin` add to Git configuration output?
git config --local user.name "Foxipa Learner"git config --local --list --show-origin
Keep the laboratory isolated
Configuration commands can modify real user settings when used without an explicit scope. In Foxipa’s verification suite, every Git test runs in a disposable repository and uses repository-local configuration. This prevents curriculum tests from changing the machine-wide or user-wide Git configuration.
git config --local user.name "Foxipa Learner"
git config --local user.email "learner@example.invalid"
git config --local --get-regexp "^user\.(name|email)$"The goal is not to hide configuration scope from the learner. It is to make the scope explicit before demonstrating a command that changes persistent Git configuration.
Quick check
Which scope should the lesson’s disposable repository use when configuring its practice identity?
git init -b maingit config --local user.email "learner@example.invalid"
A compact diagnostic workflow
A useful starting diagnostic sequence is: identify Git, ask Git for its own help, then inspect or set repository-local configuration when a repository requires identity settings.
git help
git help -a
git help --guides
git help --configThe final two commands may report no value if the repository has not configured those keys. That is a meaningful state, not an error in the Git command itself.
Quick check
If `git config --local --get user.name` produces no value, what should you conclude first?
git config --local --unset user.name || truegit config --local --get user.name
Practice what you learned
Use the dedicated Git code-completion exercise for this lesson.
Official-source boundary
This lesson uses the Git project’s own command documentation and user manual as its authority. Installation procedures are intentionally not reproduced as one universal command because the official Git installation instructions differ by platform. The learner should use the official Git installation page for their operating system, then return here to verify the installed executable.
Thanks for your feedback.
Mark this learning resource complete to track your learning progress.