[
  {
    "id": "quick_start_work",
    "type": "tutorial",
    "topic": "quickstart",
    "title": "Start a normal work session",
    "question": "What commands should I run before editing?",
    "tags": ["daily", "pull", "main", "status", "workflow"],
    "content_md": "From a working copy:\n\n```bash\ngit status\ngit checkout main\ngit pull\n```\n\nResolve, commit, stash, or discard uncommitted work before pulling if Git reports a conflict or refuses to merge.",
    "source": "Session workflow"
  },
  {
    "id": "quick_commit_push",
    "type": "tutorial",
    "topic": "quickstart",
    "title": "Commit and push normal changes",
    "question": "What is the standard edit, commit, and push sequence?",
    "tags": ["daily", "add", "commit", "push", "workflow"],
    "content_md": "After editing and testing:\n\n```bash\ngit status\ngit add -A\ngit commit -m \"Describe the change\"\ngit push\n```\n\nUse `git add file1 file2` instead of `git add -A` when you only want selected files in the commit.",
    "source": "Session workflow"
  },
  {
    "id": "quick_release",
    "type": "tutorial",
    "topic": "quickstart",
    "title": "Release a tested version",
    "question": "What is the short recipe for a new release?",
    "tags": ["release", "VERSION", "tag", "bump", "push"],
    "content_md": "After release changes are committed and tested:\n\n```bash\n./git-bump-version 3.0.0\ngit push origin main\ngit push origin --tags\n```\n\nThe helper updates `VERSION`, commits it, and creates tag `v3.0.0`. The two pushes publish the branch and tag.",
    "source": "Session workflow"
  },
  {
    "id": "quick_check",
    "type": "cheat",
    "topic": "quickstart",
    "title": "Quick safety check before pull or push",
    "question": "What should I check before synchronizing?",
    "tags": ["status", "branch", "upstream", "safety", "pull", "push"],
    "content_md": "```bash\ngit status\ngit branch --show-current\ngit rev-parse --abbrev-ref @{u}\n```\n\nThis shows uncommitted work, the current branch, and its tracking branch.",
    "source": "Session workflow"
  },
  {
    "id": "quick_old_file",
    "type": "cheat",
    "topic": "quickstart",
    "title": "Inspect an old released file without changing current files",
    "question": "How do I quickly view README.md from v1?",
    "tags": ["show", "old version", "README", "tag"],
    "content_md": "```bash\ngit show v1:README.md\n```\n\nSave it to a separate file if needed:\n\n```bash\ngit show v1:README.md > README.v1.md\n```",
    "source": "Session workflow"
  },
  {
    "id": "setup_ssh",
    "type": "task",
    "topic": "setup",
    "title": "Confirm SSH access to the Git server",
    "question": "How do I confirm SSH works before using Git?",
    "tags": ["ssh", "server", "port 2222", "key", "connection"],
    "content_md": "Run from macOS or another Linux client:\n\n```bash\nssh -p 2222 intel145@209.182.212.74 'echo SSH_OK'\n```\n\nIf it prints `SSH_OK`, SSH connectivity works. Git over SSH will not work until this succeeds.",
    "source": "tasks.md"
  },
  {
    "id": "setup_ssh_config",
    "type": "tutorial",
    "topic": "setup",
    "title": "Configure SSH once for port 2222 and key",
    "question": "How do I avoid typing SSH port and identity options every time?",
    "tags": ["ssh config", "port 2222", "identityfile", "id_rsa"],
    "content_md": "Add a host entry to `~/.ssh/config` on the client machine:\n\n```ssh\nHost gitserver\n    HostName 209.182.212.74\n    User intel145\n    Port 2222\n    IdentityFile ~/.ssh/id_rsa\n    IdentitiesOnly yes\n```\n\nThen test with `ssh gitserver 'echo SSH_OK'`. You can use `gitserver:/home/intel145/...` in scp-style Git URLs afterward.",
    "source": "Session Q&A"
  },
  {
    "id": "setup_layout",
    "type": "glossary",
    "topic": "setup",
    "title": "Bare repository versus working copy",
    "question": "Which folder do I edit, and which folder stores the remote repository?",
    "tags": ["bare repo", "working copy", "git.git", "apps", "server"],
    "content_md": "A bare repository is central storage with no checked-out files, such as `/home/intel145/websites/gitrepo/proj1.git`. Do not edit or run normal `git add`/`git commit` work there.\n\nA working copy is where you edit, test, stage, commit, and push, such as `~/projects/proj1` on macOS or `/home/intel145/websites/apps/proj1` on Linux.",
    "source": "tasks.md"
  },
  {
    "id": "setup_clone",
    "type": "tutorial",
    "topic": "setup",
    "title": "Clone current project from the SSH server",
    "question": "How do I get the current version of a project from the remote repository?",
    "tags": ["clone", "ssh", "remote", "current version", "macos", "linux"],
    "content_md": "Use the `ssh://` URL form so the custom port is included:\n\n```bash\nmkdir -p ~/projects\ncd ~/projects\ngit clone ssh://intel145@209.182.212.74:2222/home/intel145/websites/gitrepo/proj1.git proj1\ncd proj1\n```\n\nVerify:\n\n```bash\ngit remote -v\ngit branch -a\ncat VERSION\ngit describe --tags --always\n```",
    "source": "faq4.md"
  },
  {
    "id": "setup_git_identity",
    "type": "task",
    "topic": "setup",
    "title": "Set Git author identity",
    "question": "Why might commit fail with unknown author identity?",
    "tags": ["user.name", "user.email", "commit", "identity"],
    "content_md": "Set your commit identity once on a development machine:\n\n```bash\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"you@example.com\"\n```\n\nCheck it with:\n\n```bash\ngit config --global --list | grep '^user\\.'\n```",
    "source": "Session Q&A"
  },
  {
    "id": "setup_bare_integrity",
    "type": "task",
    "topic": "setup",
    "title": "Verify a bare repository is valid",
    "question": "How do I make sure a bare repository is correct?",
    "tags": ["bare", "fsck", "show-ref", "integrity", "repository"],
    "content_md": "```bash\ngit --git-dir=/home/intel145/websites/gitrepo/proj1.git rev-parse --is-bare-repository\ngit --git-dir=/home/intel145/websites/gitrepo/proj1.git fsck --full\ngit --git-dir=/home/intel145/websites/gitrepo/proj1.git show-ref\n```\n\n`true` confirms a bare repo. A fresh repo may have no refs until an initial commit is pushed.",
    "source": "Session Q&A"
  },
  {
    "id": "remote_origin_meaning",
    "type": "glossary",
    "topic": "remote",
    "title": "Meaning of git remote add origin",
    "question": "What does git remote add origin mean?",
    "tags": ["origin", "remote add", "alias", "url"],
    "content_md": "The command stores a named connection from the local working copy to another repository:\n\n```bash\ngit remote add origin <url>\n```\n\n`origin` is a conventional nickname. `git push origin main` means push local `main` to the repository named `origin`.",
    "source": "Session Q&A"
  },
  {
    "id": "remote_add_syntax",
    "type": "faq",
    "topic": "remote",
    "title": "Correct SSH remote syntax with port 2222",
    "question": "What was wrong with git remote add origin ssh -p 2222 user@host -i key?",
    "tags": ["remote add", "ssh", "port", "2222", "identity file", "url"],
    "content_md": "`git remote add` accepts a remote name and one URL. SSH options such as `-p` and `-i` are not separate Git remote arguments. Use:\n\n```bash\ngit remote add origin ssh://intel145@209.182.212.74:2222/home/intel145/websites/gitrepo/proj1.git\n```\n\nConfigure the identity file in `~/.ssh/config` or use `GIT_SSH_COMMAND` when needed.",
    "source": "Session Q&A"
  },
  {
    "id": "remote_check",
    "type": "task",
    "topic": "remote",
    "title": "Check or repair a configured remote",
    "question": "How do I check or fix the remote URL?",
    "tags": ["remote", "origin", "set-url", "ssh url", "push", "fetch"],
    "content_md": "Inspect remotes:\n\n```bash\ngit remote -v\n```\n\nUpdate an existing remote:\n\n```bash\ngit remote set-url origin ssh://intel145@209.182.212.74:2222/home/intel145/websites/gitrepo/proj1.git\n```\n\nIf it does not exist yet, use `git remote add origin <url>`.",
    "source": "tasks.md"
  },
  {
    "id": "remote_existing",
    "type": "faq",
    "topic": "remote",
    "title": "Remote already exists",
    "question": "What do I do when Git says remote git already exists?",
    "tags": ["remote exists", "set-url", "origin", "git"],
    "content_md": "Do not run `git remote add` again. Inspect the existing remote:\n\n```bash\ngit remote -v\n```\n\nThen repair it, for example:\n\n```bash\ngit remote set-url git /home/intel145/websites/gitrepo/git.git\n```\n\nOr replace that local path with the correct SSH URL.",
    "source": "Session Q&A"
  },
  {
    "id": "remote_local_path",
    "type": "tutorial",
    "topic": "remote",
    "title": "Use a local filesystem path as a remote",
    "question": "How do I use a repository on the same machine as a remote?",
    "tags": ["local remote", "file", "bare repository", "path"],
    "content_md": "A local bare repository can be used as a remote by path:\n\n```bash\ngit remote add origin /home/intel145/websites/gitrepo/proj1.git\ngit push -u origin main\n```\n\n`file:///home/intel145/.../proj1.git` also works.",
    "source": "Session Q&A"
  },
  {
    "id": "remote_clone_port",
    "type": "faq",
    "topic": "remote",
    "title": "Clone timeout because SSH tried port 22",
    "question": "Why did git clone user@host:path fail on port 22?",
    "tags": ["clone", "port 22", "port 2222", "timeout", "ssh"],
    "content_md": "The scp-style syntax defaults to SSH port 22. If the server listens on 2222, use:\n\n```bash\ngit clone ssh://intel145@209.182.212.74:2222/home/intel145/websites/gitrepo/git.git git\n```\n\nOr define port 2222 in `~/.ssh/config`.",
    "source": "Session Q&A"
  },
  {
    "id": "remote_pull_latest",
    "type": "tutorial",
    "topic": "remote",
    "title": "Pull latest files from remote main",
    "question": "How do I get current remote files before starting work?",
    "tags": ["pull", "fetch", "main", "latest", "sync", "remote"],
    "content_md": "From a clean working copy:\n\n```bash\ngit fetch origin\ngit checkout main\ngit pull\n```\n\nIf your remote is named `git` rather than `origin`, replace the name in the command.",
    "source": "tasks.md"
  },
  {
    "id": "remote_ls_refs",
    "type": "cheat",
    "topic": "remote",
    "title": "List actual branches and tags on the remote",
    "question": "How do I inspect remote branches without guessing?",
    "tags": ["ls-remote", "remote branches", "tags", "refs"],
    "content_md": "```bash\ngit ls-remote --heads origin\ngit ls-remote --tags origin\n```\n\nThis queries the remote directly. `git branch -r` shows locally cached remote-tracking refs after a fetch.",
    "source": "Session Q&A"
  },
  {
    "id": "workflow_initial_repo",
    "type": "tutorial",
    "topic": "workflow",
    "title": "Create proj1, its central bare repo, and publish first commit",
    "question": "How do I create a new dev project and repository?",
    "tags": ["new project", "proj1", "init", "bare repo", "initial push"],
    "content_md": "On a development machine:\n\n```bash\nmkdir -p ~/projects/proj1\ncd ~/projects/proj1\ngit init -b main\necho '# proj1' > README.md\ngit add README.md\ngit commit -m 'Initial commit'\n```\n\nOn the Linux server:\n\n```bash\nmkdir -p /home/intel145/websites/gitrepo\ngit init --bare /home/intel145/websites/gitrepo/proj1.git\n```\n\nBack in the working copy:\n\n```bash\ngit remote add origin ssh://intel145@209.182.212.74:2222/home/intel145/websites/gitrepo/proj1.git\ngit push -u origin main\n```",
    "source": "git.cheatsheet.md"
  },
  {
    "id": "workflow_v1",
    "type": "tutorial",
    "topic": "workflow",
    "title": "Create and publish the first v1 release",
    "question": "How do I update project files, create v1, tag it, and update the repository?",
    "tags": ["v1", "first release", "tag", "VERSION", "push"],
    "content_md": "After editing and testing:\n\n```bash\ngit add -A\ngit commit -m 'Complete v1 work'\n./git-bump-version 1.0.0\ngit push origin main\ngit push origin --tags\n```\n\nThe helper creates tag `v1.0.0`. If desired, create a short alias tag too:\n\n```bash\ngit tag -a v1 -m 'Release v1'\ngit push origin v1\n```",
    "source": "git.cheatsheet.md"
  },
  {
    "id": "workflow_two_env",
    "type": "tutorial",
    "topic": "workflow",
    "title": "Use macOS and Linux working copies with one server repository",
    "question": "Is it correct to develop on macOS and Linux against one central repo?",
    "tags": ["macos", "linux", "two environments", "central repo", "sync"],
    "content_md": "Yes. Each machine has its own working copy; the Linux bare repository is the shared central storage. On whichever machine you begin work, first pull `main`. Edit, test, commit, tag a release when ready, and push. On the other machine, pull before starting more work.",
    "source": "faq2.md"
  },
  {
    "id": "workflow_proj1fix",
    "type": "tutorial",
    "topic": "workflow",
    "title": "Clone proj1 into a separate proj1fix folder",
    "question": "How do I get latest proj1 into dev/proj1fix, edit it, and send changes back?",
    "tags": ["proj1", "proj1fix", "clone", "fix", "push"],
    "content_md": "```bash\nmkdir -p ~/dev\ncd ~/dev\ngit clone ssh://intel145@209.182.212.74:2222/home/intel145/websites/gitrepo/proj1.git proj1fix\ncd proj1fix\n```\n\nThen edit, test, commit, and push:\n\n```bash\ngit add -A\ngit commit -m 'Fix description'\ngit push origin main\n```",
    "source": "git.cheatsheet.md"
  },
  {
    "id": "workflow_script_pull",
    "type": "task",
    "topic": "workflow",
    "title": "Requirements for a simple pull script",
    "question": "Can a pull script always fetch current files from the same SSH server?",
    "tags": ["script", "pull", "ssh", "remote", "main"],
    "content_md": "A pull helper still needs a configured remote and working SSH access. The reliable core is:\n\n```bash\ngit checkout main\ngit pull origin main\n```\n\nA script may use a fixed remote name, but it cannot bypass the remote URL, SSH setup, or uncommitted-change checks.",
    "source": "Session Q&A"
  },
  {
    "id": "versions_tags",
    "type": "faq",
    "topic": "versions",
    "title": "When to use tags",
    "question": "When should I use tags?",
    "tags": ["tag", "release", "version", "milestone", "v1", "v2"],
    "content_md": "Use tags to mark fixed release or milestone commits such as `v1.0.0`, `v2.0.0`, and `v2.1.0`. A branch is for ongoing development; a tag is a named snapshot that should normally remain unchanged.\n\n```bash\ngit tag -a v2.0.0 -m 'Release v2.0.0'\ngit push origin --tags\n```",
    "source": "faq1.md"
  },
  {
    "id": "versions_release",
    "type": "tutorial",
    "topic": "versions",
    "title": "Make changes and release v3.0.0",
    "question": "How do I get current files, make changes, make v3.0.0, and update the server?",
    "tags": ["release", "v3.0.0", "VERSION", "tag", "push", "workflow"],
    "content_md": "```bash\ngit checkout main\ngit pull\n# edit and test files\ngit add -A\ngit commit -m 'Implement v3 features'\n./git-bump-version 3.0.0\ngit push origin main\ngit push origin --tags\n```\n\nThe script updates `VERSION`, commits it, and creates `v3.0.0`.",
    "source": "faq4.md"
  },
  {
    "id": "versions_check",
    "type": "cheat",
    "topic": "versions",
    "title": "Check current project version and release state",
    "question": "How do I tell what project version or tag I have?",
    "tags": ["VERSION", "describe", "tag", "current version", "status"],
    "content_md": "```bash\ncat VERSION\ngit describe --tags --always\ngit status\n```\n\nAn exact tag such as `v2.1.0` with a clean working tree indicates a released state. `v2.1.0-3-gabcd123` means three commits past that tag.",
    "source": "faq3.md"
  },
  {
    "id": "versions_bump_scope",
    "type": "faq",
    "topic": "versions",
    "title": "What git-bump-version changes",
    "question": "Does the version script add a version and filename into every file?",
    "tags": ["bump version", "VERSION", "headers", "all files", "script"],
    "content_md": "The normal version script changes only the root `VERSION` file, commits it, and creates a release tag. It does not add filename or version headers to every source file.\n\nThis avoids noisy diffs. Prefer `VERSION` as the single source of truth, or generate one version config file during build/deploy.",
    "source": "Session Q&A"
  },
  {
    "id": "versions_bump_usage",
    "type": "cheat",
    "topic": "versions",
    "title": "Run git-bump-version in a working copy",
    "question": "Why did git-bump-version fail when used against git.git?",
    "tags": ["git-bump-version", "working tree", "bare repo", "current directory"],
    "content_md": "Run it in a normal working copy, not in a bare `*.git` folder:\n\n```bash\ncd /home/intel145/websites/apps/git\n./git-bump-version 2.0.0\n```\n\nA bare repo has no work tree, so `git add` and `git commit` cannot run there.",
    "source": "Session Q&A"
  },
  {
    "id": "versions_semver",
    "type": "glossary",
    "topic": "versions",
    "title": "Use MAJOR.MINOR.PATCH versions",
    "question": "Why should I use 2.0.0 instead of 2.0?",
    "tags": ["semantic version", "semver", "major", "minor", "patch"],
    "content_md": "Use three numeric parts: `MAJOR.MINOR.PATCH`. Examples: `1.0.0`, `2.0.0`, `2.1.0`, `2.1.1`.\n\n- Major: breaking changes\n- Minor: backwards-compatible features\n- Patch: backwards-compatible fixes\n\nThe supplied bump script expects this three-part form when auto-incrementing.",
    "source": "Session Q&A"
  },
  {
    "id": "branches_list",
    "type": "cheat",
    "topic": "branches",
    "title": "List local, remote, and all branches",
    "question": "How do I list branches?",
    "tags": ["branch", "list", "local", "remote", "all"],
    "content_md": "```bash\ngit branch       # local branches\ngit branch -r    # remote-tracking branches\ngit branch -a    # local and remote-tracking branches\n```\n\nUse `git fetch origin --prune` first if you need fresh remote branch information.",
    "source": "Session Q&A"
  },
  {
    "id": "branches_current",
    "type": "cheat",
    "topic": "branches",
    "title": "Show the current branch",
    "question": "How do I check which branch I am currently on?",
    "tags": ["current branch", "show current", "HEAD"],
    "content_md": "```bash\ngit branch --show-current\n```\n\nAlternatives: `git branch`, `git rev-parse --abbrev-ref HEAD`, or `git status`. `git branch` marks the current branch with `*`.",
    "source": "Session Q&A"
  },
  {
    "id": "branches_upstream",
    "type": "cheat",
    "topic": "branches",
    "title": "Show tracking remote branch",
    "question": "How do I check the remote tracking branch for the current branch?",
    "tags": ["upstream", "tracking", "origin/main", "remote branch"],
    "content_md": "```bash\ngit rev-parse --abbrev-ref --symbolic-full-name @{u}\n```\n\nExample output: `origin/main`. To see upstreams for all local branches:\n\n```bash\ngit branch -vv\n```",
    "source": "Session Q&A"
  },
  {
    "id": "branches_when",
    "type": "faq",
    "topic": "branches",
    "title": "When to create a new branch",
    "question": "When do I change to a new branch?",
    "tags": ["branch", "feature", "experiment", "main", "maintenance"],
    "content_md": "For one active release line, stay on `main` and use tags for v1, v2, v3, and so on. Create a branch for isolated feature work, experiments, a risky refactor, or maintenance on an older release.\n\n```bash\ngit checkout main\ngit pull\ngit checkout -b feature/new-auth\n```",
    "source": "faq3.md"
  },
  {
    "id": "branches_maintenance",
    "type": "tutorial",
    "topic": "branches",
    "title": "Maintain v2 while developing v3",
    "question": "When do I need a version branch such as 2.x?",
    "tags": ["2.x", "3.x", "maintenance", "hotfix", "parallel versions"],
    "content_md": "Create long-lived maintenance branches only when two major versions need simultaneous support:\n\n```bash\ngit checkout v2.0.0\ngit checkout -b 2.x\ngit push -u origin 2.x\n```\n\nMake v2 fixes on `2.x`, tag them as `v2.0.1`, and continue v3 work on `main`.",
    "source": "faq1.md"
  },
  {
    "id": "branches_old_tag_fix",
    "type": "tutorial",
    "topic": "branches",
    "title": "Modify a file based on old v1.1",
    "question": "How do I modify v1.1 of README.md and commit back?",
    "tags": ["old tag", "v1.1", "README.md", "branch", "hotfix"],
    "content_md": "Do not modify a published tag. Make a branch starting from it:\n\n```bash\ngit checkout v1.1\ngit checkout -b fix/readme-from-v1.1\nvi README.md\ngit add README.md\ngit commit -m 'Update README based on v1.1'\n```\n\nTag a follow-up release such as `v1.1.1`, then push the branch and tag.",
    "source": "Session Q&A"
  },
  {
    "id": "files_status",
    "type": "cheat",
    "topic": "files",
    "title": "List edited, staged, and untracked files",
    "question": "How do I see files being edited or checked out?",
    "tags": ["status", "modified", "staged", "untracked", "files"],
    "content_md": "```bash\ngit status\n```\n\nIt groups files into staged changes, unstaged changes, and untracked files. Use it before committing, pulling, or pushing.",
    "source": "Session Q&A"
  },
  {
    "id": "files_list",
    "type": "cheat",
    "topic": "files",
    "title": "List all tracked files in current version",
    "question": "How do I list all files in proj1?",
    "tags": ["list files", "ls-files", "ls-tree", "tracked"],
    "content_md": "```bash\ngit ls-files\n```\n\nOr list files in the current commit:\n\n```bash\ngit ls-tree -r HEAD --name-only\n```",
    "source": "Session Q&A"
  },
  {
    "id": "files_diff",
    "type": "cheat",
    "topic": "files",
    "title": "Compare README.md between v1 and v2",
    "question": "How do I compare README.md in v1 versus v2?",
    "tags": ["diff", "README.md", "v1", "v2", "compare"],
    "content_md": "```bash\ngit --no-pager diff v1 v2 -- README.md\n```\n\nUse full tag names such as `v1.0.0` and `v2.0.0` if that is how your tags are named.",
    "source": "Session Q&A"
  },
  {
    "id": "files_get_old",
    "type": "cheat",
    "topic": "files",
    "title": "View or save README.md from v1",
    "question": "How do I get v1 of README.md without changing current files?",
    "tags": ["show", "old version", "README.md", "tag", "export"],
    "content_md": "View:\n\n```bash\ngit show v1:README.md\n```\n\nSave separately:\n\n```bash\ngit show v1:README.md > README.v1.md\n```\n\nThis does not alter the current working copy.",
    "source": "Session Q&A"
  },
  {
    "id": "files_history",
    "type": "cheat",
    "topic": "files",
    "title": "See commit history of one file",
    "question": "How do I see what versions of a file exist?",
    "tags": ["history", "file versions", "log", "README.md", "commits"],
    "content_md": "```bash\ngit log --decorate --oneline -- README.md\n```\n\nFor actual patches:\n\n```bash\ngit log --decorate -p -- README.md\n```",
    "source": "Session Q&A"
  },
  {
    "id": "files_all_versions",
    "type": "tutorial",
    "topic": "files",
    "title": "List and export all tagged versions of one file",
    "question": "How do I see what versions of a file exist and get each version?",
    "tags": ["file versions", "export", "tags", "show", "README.md"],
    "content_md": "```bash\nmkdir -p versions\nfor tag in $(git tag -l 'v*' | sort -V); do\n  git show \"$tag:README.md\" > \"versions/README.$tag.md\"\ndone\n```\n\nIf a tag predates the file, `git show` will fail for that tag; that is expected.",
    "source": "Session Q&A"
  },
  {
    "id": "files_restore",
    "type": "cheat",
    "topic": "files",
    "title": "Restore one file from an older version",
    "question": "How do I put README.md from v1 into my current working copy?",
    "tags": ["restore", "checkout", "old version", "README.md", "v1"],
    "content_md": "```bash\ngit checkout v1 -- README.md\n```\n\nThis replaces and stages `README.md`. Review using `git diff --cached`, then commit if intended.",
    "source": "Session Q&A"
  },
  {
    "id": "files_describe_error",
    "type": "faq",
    "topic": "files",
    "title": "Why git describe fails when given README.md",
    "question": "Why does git describe --tags --always -- README.md say not a valid object name?",
    "tags": ["describe", "README.md", "object name", "tag"],
    "content_md": "`git describe` accepts commits or refs, not file paths. Use:\n\n```bash\ngit describe --tags --always\n```\n\nFor a file's history use `git log --decorate --oneline -- README.md`; for file content at a tag use `git show v1:README.md`.",
    "source": "Session Q&A"
  },
  {
    "id": "files_pager",
    "type": "cheat",
    "topic": "files",
    "title": "Disable Git pager (more/less)",
    "question": "How do I stop Git from using more or less?",
    "tags": ["pager", "more", "less", "no-pager", "diff"],
    "content_md": "For one command:\n\n```bash\ngit --no-pager diff v1 v2 -- README.md\n```\n\nDisable paging for diffs globally:\n\n```bash\ngit config --global pager.diff false\n```\n\nOr avoid paging for short output:\n\n```bash\ngit config --global core.pager 'less -F -X'\n```",
    "source": "Session Q&A"
  },
  {
    "id": "files_add_ignore",
    "type": "faq",
    "topic": "files",
    "title": "Add selected files and ignore files/folders",
    "question": "How do I git add a list of files and ignore files or folders?",
    "tags": ["git add", "gitignore", "ignore", "folder", "stage", "untrack"],
    "content_md": "Stage selected files:\n\n```bash\ngit add README.md VERSION src/main.php\n```\n\nExample `.gitignore`:\n\n```gitignore\n*.log\ntmp/\n.DS_Store\n.env\njunk\nold/\n```\n\nTo stop tracking an already tracked file but retain it locally:\n\n```bash\ngit rm --cached junk\necho 'junk' >> .gitignore\ngit add .gitignore\n```",
    "source": "faq5.md"
  },
  {
    "id": "files_sizes_dates",
    "type": "cheat",
    "topic": "files",
    "title": "Check file dates, sizes, and largest history objects",
    "question": "How do I inspect repository files, dates, sizes, and versions?",
    "tags": ["sizes", "dates", "largest files", "history", "stat"],
    "content_md": "Last change date for one file:\n\n```bash\ngit log -1 --format='%ad' --date=short -- README.md\n```\n\nSizes of tracked working-tree files:\n\n```bash\ngit ls-files | xargs ls -lSh\n```\n\nLargest objects ever committed:\n\n```bash\ngit rev-list --objects --all | \\\n  git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | \\\n  sed -n 's/^blob //p' | sort -k2 -nr | head -n 20\n```",
    "source": "faq1.md"
  },
  {
    "id": "files_diff_worktree",
    "type": "cheat",
    "topic": "files",
    "title": "Compare current file to last commit",
    "question": "How do I see unstaged or staged README changes?",
    "tags": ["diff", "working tree", "staged", "cached", "README"],
    "content_md": "Unstaged changes:\n\n```bash\ngit diff -- README.md\n```\n\nStaged changes:\n\n```bash\ngit diff --cached -- README.md\n```\n\nWorking file versus last commit:\n\n```bash\ngit diff HEAD -- README.md\n```",
    "source": "Session Q&A"
  },
  {
    "id": "bare_parent_error",
    "type": "faq",
    "topic": "setup",
    "title": "Why git branch fails in the bare-repository parent folder",
    "question": "Why did git branch say not a git repository in websites/gitrepo?",
    "tags": ["not a git repository", "bare", "parent folder", "git branch"],
    "content_md": "`/home/intel145/websites/gitrepo` is a container holding several bare repositories; it is not itself a repository. Point Git at one actual bare repo:\n\n```bash\ngit --git-dir=/home/intel145/websites/gitrepo/defapp.git branch -a\n```\n\nFor normal editing, clone it into a working copy.",
    "source": "Session Q&A"
  },
  {
    "id": "bare_empty_refs",
    "type": "faq",
    "topic": "setup",
    "title": "Bare repo has no branches or show-ref returns 1",
    "question": "What does empty output and exit code 1 from git show-ref mean?",
    "tags": ["show-ref", "exit 1", "empty repository", "bare", "branches"],
    "content_md": "A newly initialized bare repo has no commits, branches, tags, or refs. `git show-ref` can print nothing and return 1. Push an initial commit from a working copy to create `main`.\n\n```bash\ngit --git-dir=/home/intel145/websites/gitrepo/defapp.git show-ref\n```",
    "source": "Session Q&A"
  }
]
