Lesson 2 · Foundations
Install Git and preview a safe commit identity
Check which Git your terminal runs, install it only if needed, and preview a fictional name and email without changing your personal configuration. Then inspect GitTree's identity controls without saving them.
- Level: Beginner
- 10 min read
- 5 min video
- Updated
- Before this lesson: Distinguish Git, GitTree and your hosting provider
Progress saved in this browser.
Playing loads the video from YouTube (privacy-enhanced mode).
What you will learn
- Distinguish a missing executable from a missing repository.
- Verify Git's path and version rather than trusting an installer message.
- Explain command, repository and global identity scope.
- Preview GitTree Demo without changing an existing identity.
Before you start
Finish lesson 1 first. You start with no course repository: nothing has been initialized yet. Use a terminal folder that is not a repository and GitTree's New Tab screen. Do not initialize anything before lesson 4.
The terminal commands were checked with Git 2.52.0 on macOS (/opt/homebrew/bin/git) and on Ubuntu 24.04 (/opt/git-2.52/bin/git). Your path and version can differ. GitTree's inspected requirement is Git 2.39.0 or newer; that floor is not a claim that 2.39.0 is today's latest or preferred security update. Choose a maintained package for your platform and verify it.
Native Git needs no sign-in. GitTree asks you to sign in with your email or a Git provider; the Free plan then covers every local Git feature, and your repositories stay on your computer. The recording predates that requirement, so the sign-in dialog is not shown. Author identity is not a GitTree account, provider credential or cryptographic signature. The GitTree steps were recorded in GitTree 2.0 on Ubuntu 24.04. On macOS, press Command where Windows and Linux use Ctrl.
Concept
A commit normally records both an author and a committer, each with a name and email. They can differ when someone applies another person's work. The ordinary starting case uses your configured identity for both. Writing a name does not prove that person owns an account; signing and hosting verification are separate subjects.
Think of identity configuration as choosing the return address on future records, not logging in to a server. Existing commits are not renamed when configuration changes. A pushed commit can expose its recorded email, so use an address you intend to make part of that history. All addresses in this course are fictional.
| Scope or mechanism | Persistence | Effect |
|---|---|---|
Native git -c key=value … | That Git invocation | Overrides that config key for the command; does not save it |
| Repository-local config | Repository config, normally .git/config | Applies to that repository; set deliberately after lesson 4 creates it |
| Global config | User's global Git configuration | Supplies defaults across repositories, subject to overrides |
| GitTree injected profile | GitTree profile plus commands it runs | Does not rewrite global Git config; outside terminals do not inherit it |
| GitTree write-global profile | Global config on profile switch | Affects other Git tools too; not used here |
For ordinary scalar user.name and user.email, repository configuration overrides global defaults; explicit native -c overrides those config values for that invocation. GitTree's injected-profile implementation deliberately preserves a repository's own identity, as its UI explains. Do not treat that profile policy as identical to a manually typed -c. Environment variables, includes and worktree configuration can introduce additional inputs; advanced identity diagnosis comes in lesson 52. See Git's config reference and command-level options.
State boundary: inspecting a version/path or previewing -c values changes no working tree, index, local ref or remote ref. Installing Git changes software on the machine. Saving a profile/configuration would persist identity settings; we cancel the preview instead.
In the terminal
1. Inspect before installing
On macOS, on Windows in Git Bash, or on Linux:
command -v git
git --versionObserved authoring output, in command order:
/opt/homebrew/bin/git
git version 2.52.0The path is this machine's result, not a required path to copy. In Windows PowerShell, use Get-Command git instead of command -v git, then run the same version query. Windows behavior has not been executed in this authoring check.
2. Install only when required
Skip this step if a usable maintained Git is already present. These commands are installation choices, not commands run while authoring this lesson. They change system software and may request approval.
- macOS: choose Xcode Command Line Tools, or Git through an already-installed Homebrew. Do not run both merely for this lesson. Official installation choices.
xcode-select --installAlternative, only when Homebrew is already available:
brew install git- Windows: obtain the installer for your architecture from the official Git for Windows installation page, finish its interactive setup, and open a fresh terminal. No specific installer-screen labels are assumed here.
- Linux: use your distribution's supported package channel. For Debian/Ubuntu, a common choice is below; Fedora uses
sudo dnf install git. Inspect the resulting version: an older distribution may supply a package below GitTree's floor. Do not add a third-party package repository without reviewing its trust and maintenance implications. Official Linux choices.
sudo apt update
sudo apt install gitInstaller/package-manager output varies by OS, package state and release; no fabricated transcript is supplied. After installation, open a fresh terminal, repeat the path/version queries and restart GitTree if necessary.
3. Preview, without saving
These native queries work without a repository. Each command carries both fictional fields explicitly.
git -c user.name="GitTree Demo" -c user.email=demo@example.com config --get user.name
git -c user.name="GitTree Demo" -c user.email=demo@example.com config --get user.emailObserved output, one line from each command:
GitTree Demo
demo@example.comNow change only the command's email:
git -c user.name="GitTree Demo" -c user.email=maya@example.com config --get user.emailObserved output:
maya@example.comThat result belongs to this invocation. The earlier command would still return demo@example.com when run again. Neither command writes a configuration file or creates a commit. We do not print all of your existing Git configuration: it can contain private addresses or credential-bearing URLs.
In GitTree
Missing or unusable Git
If discovery fails, GitTree shows GitTree needs Git, This Git is too old or This Git could not be used. Looked in lists the paths it searched when Git is missing. Install or repair Git outside the app, then choose Check again: GitTree looks again and, only if it finds a usable Git, opens the regular New Tab. The video shows this on a machine where Git is hidden from the app alone: the missing-Git screen, then the same screen after Git is visible again, then New Tab.
Locate Git… also appears on that screen, but in the inspected source its action is empty, so do not rely on it as a working picker; use Check again after you fix the installation. You never need to uninstall a working Git to see this screen.
Preview identity with no repository
- From New Tab, open Preferences (
app.preferences.open): Command+, on macOS, Ctrl+, on Windows/Linux. Expect the full-window Preferences screen. - Choose Profiles in its navigation. Read the warning that Passed to each git command applies only to Git commands GitTree runs. If there are existing profiles, do not edit or switch them.
- Choose New profile. Expect an unsaved form.
- In Profile name, type
Course preview. In Name for commits (user.name), typeGitTree Demo. In Email for commits (user.email), typedemo@example.com. - Leave Signing key (user.signingkey) and SSH command (core.sshCommand) empty. Under How the identity reaches git, inspect Passed to each git command. Do not select Written to ~/.gitconfig.
- Choose Cancel, not Create profile. Expect the unsaved form to close without adding a profile. Choose Exit Preferences to return to New Tab.
- Alternative route for later inspection: open Command Palette… with Command+Shift+P / Ctrl+Shift+P, type Switch Profile…, and select that exact command (
profile.switch). It opens Profiles; it does not silently choose a different identity. Close via Exit Preferences without switching.
A separate Set up your Git identity dialog appears after an identity-related commit failure. It has Name, Email and explicit save targets. We do not force such a failure without a repository, and we do not use that dialog in this preview. Lesson 4 supplies the repository-local identity; lesson 52 teaches persisted profiles and configuration in depth.
Result
At the end, you know the installed path/version and can predict the fictional command-scoped identity. There is still no course working tree, index, branch history, remote or graph. No global config or profile was saved.
Common mistakes
- Installing GitTree and expecting bundled Git: the inspected setup flow uses your own Git installation.
- Using the account email as automatic Git identity: account and commit metadata are separate.
- Saving a fictional global identity: this can affect unrelated work; use the preview and the later course-repository-local setup.
- Assuming a profile changes external terminals: injected profiles apply to GitTree's commands, not arbitrary terminal processes.
- Expecting a name/email to authenticate a push: credentials and server permissions are separate.
If something goes wrong
If the version command cannot run, check installation and the terminal environment before investigating repository status. If Git runs but reports “not a git repository,” Git is present; initialization belongs in lesson 4.
If the shell and app disagree, restart the app after installation and choose Check again if the gate remains visible. Inspect the path/version in its diagnostic text when available. The source's inactive Locate callback is not a proven recovery path.
If you accidentally save or switch a profile, stop. Note which mechanism changed before restoring your prior, known configuration through its actual control. Do not delete arbitrary profiles or erase global config: those files can contain unrelated settings. GitTree's repository Undo journal is not a promised rollback for installation or identity configuration.
Check your understanding
Answer each question, then read why. Questions marked “Required” count toward completing the lesson.
0 of 6 correct
Answer the required questions correctly to complete the lesson.
Checked in this browser.
Practice
Predict the output when the preview email changes to maya@example.com, then run the changed-input query above and compare it. Repeat the original email query. Inspect the GitTree form, cancel it, and confirm no new profile row appears. Continue with no repository initialized.
Your own confirmation: the site cannot see your computer.
To complete the lesson, answer the required questions correctly and confirm the practical exercise.
Recap
- Verify the executable and version after installation; do not infer them.
- Commit identity is recorded metadata, not account authentication.
- Preview scope is temporary; repository, global and app-profile persistence differ.
Related
Glossary terms introduced
Author — مؤلف; committer — مُودِع; commit — إيداع; profile — ملف تعريف; repository — مستودع; command palette — لوحة الأوامر. Identity metadata is not a signature.
Video transcript
The narration of the video, cue by cue.
Show the transcript
- Check Git first, then preview an identity without saving it.
- A working Git executable and a commit identity solve different problems.
- Find the executable your current shell will run.
- Now read its version, rather than guessing from an installer.
- The inspected GitTree source requires Git two point thirty-nine or newer.
- On macOS, choose supported command-line tools or an existing package manager.
- Windows users should choose the official installer for their architecture.
- On Linux, your distribution chooses the package; verify its version afterwards.
- After installation, use a fresh terminal and repeat both checks.
- GitTree can recheck discovery after you repair the installation.
- A desktop process may discover Git differently from your shell.
- The visible Locate control is not a proven working path in this source.
- Your name and email become commit metadata, not server credentials.
- Author, committer, account and signature are related but different concepts.
- Changing configuration does not rename people in existing commits.
- Pass the fictional name and email to this one Git command.
- The email query prints the value supplied to this invocation.
- A command-scoped value is not a saved global setting.
- Change only the supplied email. Predict the next result before running it.
- The changed input produces Maya's fictional address for this query only.
- Repeat the original command, and its supplied email appears again.
- Repository settings, global defaults and app profiles persist in different places.
- GitTree's injected profiles preserve the repository's own configured identity.
- Open Preferences. This is a full-window screen, not a repository operation.
- Open Profiles and read where the identity applies.
- Injected profiles affect GitTree's commands, not external terminals.
- Create an unsaved draft; we will cancel before creating a profile.
- Use a clear profile label so this preview is easy to recognize.
- Enter GitTree Demo as the fictional commit name.
- Enter the fictional address, not your personal account email.
- Keep injection mode; leave the signing key and SSH command empty.
- Cancel the draft. An open form is not a saved profile.
- Return to New Tab with no repository created.
- The palette opens Profiles without switching your identity.
- Leave again without choosing a different saved identity.
- Saving the demo globally could affect unrelated work on this machine.
- Repository Undo is not a promised rollback for installation or identity settings.
- Verify Git, separate identity from login, and choose where settings persist.
- Your check is the two email results and an unchanged profile list.
- Next, separate your working files from the snapshot you choose to commit.