[
  {
    "id": "setup_ssh",
    "type": "task",
    "topic": "setup",
    "title": "Confirm SSH access to the Linux Git server",
    "question": "How do I confirm SSH works before using Git?",
    "tags": [
      "ssh",
      "server",
      "port 2222",
      "key",
      "connection"
    ],
    "source": "tasks.md",
    "content_md": "Run this 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. A reusable `~/.ssh/config` entry can define the host, user, port, and identity file once."
  },
  {
    "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"
    ],
    "source": "tasks.md",
    "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."
  },
  {
    "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"
    ],
    "source": "faq4.md",
    "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 the clone:\n\n```bash\ngit remote -v\ngit branch -a\ncat VERSION\ngit describe --tags --always\n```"
  },
  {
    "id": "remote_check",
    "type": "task",
    "topic": "remote",
    "title": "Confirm a working copy points to the correct remote",
    "question": "How do I check or fix the remote URL?",
    "tags": [
      "remote",
      "origin",
      "set-url",
      "ssh url",
      "push",
      "fetch"
    ],
    "source": "tasks.md",
    "content_md": "Inspect configured remotes:\n\n```bash\ngit remote -v\n```\n\nSet or repair the `origin` URL:\n\n```bash\ngit remote set-url origin ssh://intel145@209.182.212.74:2222/home/intel145/websites/gitrepo/proj1.git\n```\n\nIf no `origin` remote exists yet, use `git remote add origin <url>` instead."
  },
  {
    "id": "pull_latest",
    "type": "tutorial",
    "topic": "remote",
    "title": "Get latest files from remote main",
    "question": "How do I pull the current project files before starting work?",
    "tags": [
      "pull",
      "fetch",
      "main",
      "latest",
      "sync",
      "remote"
    ],
    "source": "tasks.md",
    "content_md": "From a clean working copy:\n\n```bash\ngit fetch origin\ngit checkout main\ngit pull\n```\n\nIf you have uncommitted edits, Git may refuse to merge. Commit, stash, or discard those changes first."
  },
  {
    "id": "working_status",
    "type": "cheat",
    "topic": "files",
    "title": "List files currently being edited, staged, or untracked",
    "question": "How do I see files being edited or checked out?",
    "tags": [
      "status",
      "modified",
      "staged",
      "untracked",
      "files"
    ],
    "source": "git.cheatsheet.md",
    "content_md": "Run:\n\n```bash\ngit status\n```\n\nIt groups files into staged changes, unstaged changes, and untracked files. It is the first command to use before committing or pulling."
  },
  {
    "id": "files_list",
    "type": "cheat",
    "topic": "files",
    "title": "List all tracked files in the current project version",
    "question": "How do I list all files in proj1?",
    "tags": [
      "list files",
      "ls-files",
      "ls-tree",
      "tracked"
    ],
    "source": "git.cheatsheet.md",
    "content_md": "List tracked files:\n\n```bash\ngit ls-files\n```\n\nList files in the current commit:\n\n```bash\ngit ls-tree -r HEAD --name-only\n```"
  },
  {
    "id": "files_diff_readme",
    "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"
    ],
    "source": "git.cheatsheet.md",
    "content_md": "Use tags and a path separator:\n\n```bash\ngit --no-pager diff v1 v2 -- README.md\n```\n\nUse full tags such as `v1.0.0` and `v2.0.0` if those are the names in your repo."
  },
  {
    "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 my current files?",
    "tags": [
      "show",
      "old version",
      "README.md",
      "tag",
      "export"
    ],
    "source": "git.cheatsheet.md",
    "content_md": "View it:\n\n```bash\ngit show v1:README.md\n```\n\nSave it separately:\n\n```bash\ngit show v1:README.md > README.v1.md\n```\n\nThis does not change the current working copy."
  },
  {
    "id": "files_history",
    "type": "cheat",
    "topic": "files",
    "title": "See the commit history of one file",
    "question": "How do I see what versions of a file exist?",
    "tags": [
      "history",
      "file versions",
      "log",
      "README.md",
      "commits"
    ],
    "source": "faq3.md",
    "content_md": "Show commits that changed a file, including tag decorations:\n\n```bash\ngit log --decorate --oneline -- README.md\n```\n\nFor detailed changes, use:\n\n```bash\ngit log --decorate -p -- README.md\n```"
  },
  {
    "id": "files_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"
    ],
    "source": "faq5.md",
    "content_md": "Stage a selected list:\n\n```bash\ngit add README.md VERSION src/main.php\n```\n\nCreate `.gitignore` rules such as:\n\n```gitignore\n*.log\ntmp/\n.DS_Store\n.env\njunk\nold/\n```\n\n`.gitignore` does not affect files already tracked. To stop tracking a file but retain it locally:\n\n```bash\ngit rm --cached junk\necho 'junk' >> .gitignore\ngit add .gitignore\n```"
  },
  {
    "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"
    ],
    "source": "faq1.md",
    "content_md": "Use tags to mark fixed release or milestone commits, for example `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\nCreate an annotated release tag:\n\n```bash\ngit tag -a v2.0.0 -m 'Release v2.0.0'\ngit push origin --tags\n```"
  },
  {
    "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"
    ],
    "source": "faq4.md",
    "content_md": "From an existing clone:\n\n```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 version script updates `VERSION`, commits it, and creates tag `v3.0.0`; the two push commands publish both commits and tags."
  },
  {
    "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"
    ],
    "source": "faq3.md",
    "content_md": "Run:\n\n```bash\ncat VERSION\ngit describe --tags --always\ngit status\n```\n\nA clean working tree and an exact tag such as `v2.1.0` indicate a released state. Output such as `v2.1.0-3-gabcd123` means the current commit is three commits beyond that tag."
  },
  {
    "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"
    ],
    "source": "faq3.md",
    "content_md": "For one active release line, stay on `main` and use tags for v1, v2, v3, and so on. Create a branch when work needs isolation: a large feature, experiment, risky refactor, or a maintenance fix for an older version while new development continues.\n\nExample:\n\n```bash\ngit checkout main\ngit pull\ngit checkout -b feature/new-auth\n```"
  },
  {
    "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"
    ],
    "source": "faq1.md",
    "content_md": "Use long-lived maintenance branches only when two major versions need support simultaneously. For example, make `2.x` from the v2 release tag for v2-only fixes while `main` moves toward v3:\n\n```bash\ngit checkout v2.0.0\ngit checkout -b 2.x\ngit push -u origin 2.x\n```\n\nMake the v2 fix on `2.x`, tag `v2.0.1`, and push the branch plus tags."
  },
  {
    "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"
    ],
    "source": "faq2.md",
    "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.\n\nTypical cycle:\n\n```bash\ngit checkout main\ngit pull\n# edit and test\ngit add -A\ngit commit -m 'Change description'\ngit push origin main\n```"
  },
  {
    "id": "workflow_proj1fix",
    "type": "tutorial",
    "topic": "workflow",
    "title": "Clone proj1 into a separate proj1fix working folder",
    "question": "How do I get latest proj1 into dev/proj1fix, edit it, and send changes back?",
    "tags": [
      "proj1",
      "proj1fix",
      "clone",
      "fix",
      "push"
    ],
    "source": "git.cheatsheet.md",
    "content_md": "Create a separate working copy:\n\n```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```"
  }
]