Appendix

1. Overview

This appendix contains reference material that supports the tutorial chapters — merge strategies, Git clients, external resources, and notes. For step-by-step recipes, see the Playbook. For command help, run git help <command>.

In this chapter you will learn:

2. Merge Strategies

Git selects a merge strategy automatically. You can force one with git merge -s <strategy>.

StrategyWhen Git uses itWhat it does
recursiveDefault for two branches3-way merge; handles multiple common ancestors (criss-cross)
ortDefault in Git 2.34+Faster replacement for recursive; same behavior
octopusDefault when merging 3+ branchesMerges all at once; fails if any conflicts
oursManual only (-s ours)Records merge but ignores incoming changes entirely
subtreeManual only (-s subtree)Adjusts paths when one branch is a subdirectory of another

Note: Do not confuse the ours strategy (-s ours) with the ours option (-X ours). The strategy discards the entire branch. The option resolves individual conflicts by preferring the current branch but still includes non-conflicting changes.

3. SSH Key Setup

SSH lets you authenticate with remotes without entering a password each time. This is the recommended method for frequent use.

Generate a key

$ ssh-keygen -t ed25519 -C "you@example.com"

Accept the default file location (~/.ssh/id_ed25519). Set a passphrase when prompted — it protects the key if your machine is compromised.

Add the key to the SSH agent

$ eval "$(ssh-agent -s)"             # start the agent
$ ssh-add ~/.ssh/id_ed25519          # add your key

On Windows (Git Bash), use the same commands. On macOS, add --apple-use-keychain to avoid re-entering the passphrase.

Add the public key to GitHub

$ cat ~/.ssh/id_ed25519.pub          # copy this output

On GitHub: Settings → SSH and GPG keys → New SSH key → paste the public key.

Test the connection

$ ssh -T git@github.com
Hi username! You've successfully authenticated...

Switch a repository from HTTPS to SSH

$ git remote set-url origin git@github.com:user/repo.git

4. Git Clients

ClientPlatformNotes
GitHub DesktopWindows, macOSSimple, GitHub-focused
SourcetreeWindows, macOSFull-featured, free
GitKrakenWindows, macOS, LinuxVisual, cross-platform
TortoiseGitWindowsShell integration
Git ExtensionsWindowsLightweight, open source

5. References

Books and tutorials

Troubleshooting

Visualization

Workflows

6. Notes

  1. Git cannot commit empty folders. Add a placeholder file (e.g. .gitkeep) if you need an empty directory tracked.

  2. Unlike svn add, git add does not permanently track a file — it stages changes for the next commit. Run git add each time a file is modified.

  3. Changing the user email in configuration causes future commits to appear under a different identity. Past commits are not affected.