THE FIELD GUIDES

Git your shell together.

Give your ideas a save button. Build a tiny turtle rescue website, make a few practice mistakes, and learn how to recover. The complete guide and practice kit are free here. No account or email required.
Git Your Shell Together: Honu's beginner Git and GitHub field guide

Commits. Branches. Small wins. Fewer disasters. Learn the tools behind your projects, then review what your AI helper changes.

18-page PDF · original starter project · practice missions · command card · no paid AI tool required

Download everything in one ZIP. Use Terminal on Mac/Linux or Git Bash on Windows. Start in a new practice folder.

Your code deserves a save button.

Meet Git, GitHub and your first Honu mission.

Welcome to Git Your Shell Together. We are building a tiny turtle rescue website, making deliberate practice mistakes, and learning how to recover. No coding superpowers required. Bring a terminal, a text editor and a little curiosity.
Git records selected versions of files on your computer. A repository, or repo, is the project and its Git history. GitHub hosts remote repositories and adds issues, pull requests and collaboration tools. You can use Git without GitHub; the first missions stay on your computer.
The working tree is the set of files you edit. The index, usually called staging, holds the content prepared for your next commit. A commit records that staged snapshot with a message. Push copies commits to a remote. Saving in your editor, committing and pushing are three separate steps.
Honu says: "final-FINAL-really-final-7.html" is a cry for help. Let Git handle the versions. A commit is useful history, not an indestructible backup; keep a separate copy and push when appropriate.
Route: setup → first commit → inspect → undo → branch → GitHub → collaborate → review AI changes → resolve a conflict → recover. The included starter has index.html and rescue-log.md. Work in a new practice folder, never inside a project you already depend on.
Honu missionFinish the local missions first. GitHub is optional until the remote chapter. AI software is optional throughout: you can perform every edit yourself. No paid AI subscription is required for this practice.

Set up your little island.

Terminal choices, identity and a clean practice folder.

Use Terminal on macOS/Linux, or Git Bash on Windows for the shell examples in this guide. PowerShell has different file-writing syntax. Open a text editor for the file edits. Commands below do not include a leading $ prompt.
git --version gh --version
Git is required; gh is the optional GitHub CLI used later. If missing, use the official Git installers at git-scm.com/install and GitHub CLI instructions at cli.github.com. On a Mac, xcode-select --install offers Apple command-line tools; Homebrew users can install git and gh through their existing Homebrew setup. On Windows, the Git installer supplies Git Bash. Reopen your terminal after installation.
Make a new folder named honu-git-lab in a location you can find. Copy the contents of Practice Kit/starter into it. Do not copy the whole guide folder into the repo. Open a terminal in honu-git-lab, then initialize:
git init -b main git config user.name "Your Display Name" git config user.email "YOUR_GITHUB_NOREPLY_EMAIL" git status
Replace both quoted identity values. These commands set identity for this repo only. Your email is embedded in commits; use the exact no-reply address shown in GitHub Settings → Emails if you want to avoid publishing a personal address. These labels identify authorship; they do not authenticate you or cryptographically sign commits.
If Git rejects -b, update Git or run git init, then git branch -M main. The folder must be your new practice repo. Setting git config --global applies to other repos too, so we keep this lesson local.
Honu missionSuccess: git status says main and shows the two starter files as untracked. Untracked means Git has not added them to its tracked snapshots yet.

Save the first checkpoint.

Inspect → stage → inspect again → commit.

git status git add index.html rescue-log.md git diff --staged git commit -m "Start Honu rescue station" git log --oneline
git add stages the current contents of the named files. If you edit again afterward, the new edits are not automatically staged. git diff --staged shows the content about to enter the commit. git commit writes that snapshot to your local history. The hash displayed beside it is its ID; yours will differ from every example.
Open index.html in your browser. You should see Honu Rescue Station and a short mission card. Add a line to rescue-log.md in your text editor: "Mission 1: checked the beach." Save the file, then inspect the change:
git diff git add rescue-log.md git diff --staged git commit -m "Record first beach check" git status
Read the + and - at the start of diff lines: additions and removals. No output from git diff can simply mean the change is staged. A clean status means no tracked changes or untracked files are currently reported; ignored files can still exist.
git add . can stage many files, including removals. It is handy once you know what is in the folder. Named files keep this first mission easy to review.
Honu missionSuccess: git log --oneline shows two commits and git status reports a clean working tree. Nothing has been uploaded.

Read the tracks before you move.

Which change is where?

Add "Honu packed extra snacks." to rescue-log.md. Run git diff, then git add rescue-log.md. Now append "The seagulls have legal representation." and save again. The same file has both staged and unstaged content.
git status git diff git diff --staged git diff HEAD
Plain diff compares the working tree with staging. --staged compares staging with HEAD, usually the current commit. diff HEAD compares tracked working files with that commit. It does not include the contents of untracked files.
Unstage without discarding your editor work:
git restore --staged rescue-log.md git status git diff
Both added lines are now unstaged. Stage and commit them together when you have inspected the result:
git add rescue-log.md git commit -m "Pack snacks and log seagull incident" git log --oneline --graph --decorate
HEAD is Git's current checkout reference. On a normal branch it refers through the branch to a commit. origin/main, once you have a remote, is your locally stored view of that remote branch as of the last fetch, not a live connection.
Honu missionExplain out loud why a staged file can still have unstaged edits. If you can explain that, you have unlocked one of Git's most useful ideas.

Oops is a workflow.

Undo the right thing without guessing.

Different mistakes need different tools. To remove a change from staging while keeping it in your editor files, use git restore --staged. To discard an unstaged tracked-file edit, git restore normally copies from staging, not necessarily from the last commit.
Practice only after git status is clean. Add a disposable line to rescue-log.md, save it, inspect it, then deliberately discard it:
git diff -- rescue-log.md git restore -- rescue-log.md git status
That unstaged edit is discarded. Git may not be able to recover content it never recorded. Do not run restore on work you want to keep. If a file has staged edits, plain restore restores those staged contents.
Inspect an older committed version without switching your files: use git log --oneline, copy a real hash, and replace COMMIT_HASH below. Do not type the placeholder literally.
git show COMMIT_HASH:rescue-log.md
To look around with the whole project at an old commit, first ensure a clean working tree, then use git switch --detach COMMIT_HASH. Return with git switch main. If you make a commit while detached and want to keep it, create a branch there with git switch -c keep-my-work before leaving.
For a committed mistake already shared with others, prefer a new reversing commit with git revert COMMIT_HASH after checking that the target is an ordinary commit. Revert can conflict. A merge commit needs a separate decision about its parent; see the recovery mission.
Honu missionSuccess: the disposable line is gone, your earlier commits remain, and you know the difference between unstage, discard and revert.

Give your idea its own sandbox.

A branch holds experiments; your folder still matters.

git status git switch -c feature/beach-banner
With a clean start, edit the heading in index.html to "Honu Rescue Station: Beach Patrol". Save it, check the page in a browser, then commit:
git diff git add index.html git commit -m "Add beach patrol heading" git switch main
Reopen or refresh index.html. The original heading is back on main. Your new commit is on feature/beach-banner. A branch is a movable name for a commit, not a separate folder or a permissions boundary. Uncommitted edits can carry between branches or prevent switching.
git merge feature/beach-banner git branch -d feature/beach-banner git log --oneline --graph --decorate
This should fast-forward main because main had no competing commits. Deleting the merged branch name does not remove the commits now reachable from main. Lowercase -d checks whether Git considers the branch merged; it is not a universal guarantee that every copy of your work exists elsewhere.
Branches do not make untrusted code safe to run, and do not isolate an AI tool from your machine or account. They organize commits. Review changes and choose what commands to run.
Honu missionSuccess: main contains the beach heading and the feature branch name is gone. Honu approves your tiny, understandable change.

Keep the treasure out of the repo.

Ignore first. Inspect before upload.

Create .gitignore in the repo root, or copy the included template there, with the following patterns. The exception keeps a placeholder-only example file trackable:
.env .env.* !.env.example node_modules/ .DS_Store
Create .env with a fake training value only, such as HONU_PRACTICE_TOKEN=not-a-real-secret. Never use a working credential for the lesson. Create .env.example with HONU_PRACTICE_TOKEN=replace-locally.
git check-ignore -v .env git status --short git add .gitignore .env.example git diff --staged git commit -m "Add ignore rules and example settings"
.gitignore is a convenience filter for untracked files. It does not encrypt files, prevent git add -f, stop an app from logging secrets, or remove content already tracked. A private repository can be shared with collaborators and integrations; it is not a password vault.
If a real secret was committed, revoke or rotate it at the provider first. Adding an ignore rule or deleting the current file cannot erase copies from earlier history. Removing a tracked file with git rm --cached -- FILE_NAME stops tracking future versions but leaves earlier commits intact. Follow GitHub's sensitive-data guidance for any necessary history cleanup and coordinate with collaborators.
Honu rule: keys stay in the key cabinet, not the scrapbook. Before each push, review git status and the staged diff. Do not paste authentication tokens into AI prompts.
Honu missionSuccess: git check-ignore identifies the .env rule; the fake .env is absent from git ls-files. The example file contains placeholders only.

Give your island a remote harbor.

Create and push one private practice repo.

Install GitHub CLI from cli.github.com if you have not already. Sign in to your own GitHub account using the browser flow. Review the account and authorization shown; never paste credentials into the guide or a chat.
gh auth login gh auth status
Before creating a repo, confirm you are in honu-git-lab on main, your commits are ready and origin does not already exist. The next command creates a real private repository in the authenticated account and uploads your commits. Choose a unique repo name if this one exists.
git status git remote -v gh repo create honu-git-lab --private --source=. --remote=origin --push
This combines creation, remote setup and first push. Do not also run git remote add origin afterward. If you already created an empty repo on GitHub instead, use git remote add origin YOUR_REPO_HTTPS_URL followed by git push -u origin main. Replace the URL with your actual repo URL, and choose just one route.
git remote -v git branch -vv gh repo view --web
On GitHub, verify the repository is private and the intended files appear. Check that .env is absent. Future committed updates use git push. If Git asks for a password despite successful CLI login, gh auth setup-git can configure Git to use that login.
An empty repository created through the website should have no auto-generated README for this route. If it already has commits, stop and inspect its history instead of forcing your push.
Honu missionSuccess: your private GitHub repo contains the website, rescue log, ignore rules and placeholder example. Local commits and remote commits now match.

Push, fetch, pull, clone.

Four verbs. Four different jobs.

Push sends local commits to a remote. Fetch downloads objects and updates remote-tracking references without merging them into your current branch. Pull fetches and integrates changes. Clone creates a new working copy with its own history and remote configuration.
Make a second practice copy in a different folder. Replace YOUR_REPO_HTTPS_URL with your real URL. Run clone from the parent folder, outside the first repo:
git clone YOUR_REPO_HTTPS_URL honu-git-lab-copy cd honu-git-lab-copy git status git log --oneline
In the original copy, add a harmless line to rescue-log.md, commit it and push. In the second copy, observe that its file does not change by itself:
git fetch origin git log --oneline main..origin/main git pull --ff-only
--ff-only accepts a pull only when your branch can move straight forward. If both sides have their own commits, it stops instead of silently choosing a merge or rebase strategy. Inspect with git log --oneline --graph --all, then choose the appropriate integration workflow.
Two folders do not share uncommitted work. They synchronize commits through the remote. Configure your identity locally in the second clone before making new commits there; repo-local settings do not come along in clone.
Honu missionSuccess: the second copy receives your committed line through a fast-forward pull. If a push is rejected, fetch and inspect; do not reach for force-push.

Give the robot a job description.

A small issue beats a vague wish.

A GitHub issue describes a problem or desired change. An AI coding tool may help implement it when configured and authorized; creating an issue or assigning yourself does not automatically summon an agent.
gh issue create \ --title "Add a beach cleanup checklist" \ --body "Add three cleanup tasks. Keep existing content. No new dependencies." gh issue list
Record the actual issue number returned. Issues and pull requests share a numbering sequence, so yours will not necessarily be 1. Give an agent this scoped request, or perform the same work yourself:
Work on issue ISSUE_NUMBER in this practice repo. Start from an up-to-date main and create feature/cleanup-checklist. Change only index.html to add the requested three-item list. Show the diff and explain your verification. Do not read credentials, add services or dependencies, deploy, or merge. Ask before any action outside this task. Push the branch and open a draft pull request when the work is ready.
Review commands as well as files. An agent's effective access depends on its permissions, authentication and environment. A branch does not restrict that access. You can use the included issue template and agent prompt card without installing any paid tool.
Honu missionSuccess: the task has a visible definition of done. You can explain what should change and how you will tell it works.

Review before the victory dance.

Make a pull request you can understand.

If doing the task manually, start from a clean, updated main, create feature/cleanup-checklist, edit index.html and verify it in your browser. Then run the following from that branch:
git diff git add index.html git commit -m "Add beach cleanup checklist" git push -u origin feature/cleanup-checklist gh pr create --draft --base main \ --title "Add beach cleanup checklist" \ --body "Adds three cleanup tasks. Verified the page in a browser. Closes #ISSUE_NUMBER."
Replace ISSUE_NUMBER before running. If an agent already created the branch or PR, inspect that result instead of repeating creation. Replace PR_NUMBER in the following commands with the actual number returned:
gh pr view PR_NUMBER gh pr diff PR_NUMBER gh pr checkout PR_NUMBER
Read the changed lines, open the page, verify the heading and exactly three checklist items, and check that rescue-log.md was not changed. For a larger app, run its documented checks only after reviewing scripts and new dependencies. A green check does not prove every behavior is correct.
Once satisfied, use gh pr ready PR_NUMBER if the PR is still a draft. Merge on GitHub with the method allowed by that repo, then return locally to main and pull:
git switch main git pull --ff-only
GitHub can restrict merge methods or require reviews/checks. Respect those rules. Keep PRs small enough to review. The goal is understanding the change, not speed-running the green button.
Honu missionSuccess: the merged checklist is visible on main and the issue closes through the PR link. Review is a real step, not a decorative checkbox.

Two turtles. One sentence.

A controlled merge conflict, entirely local.

Start with a clean main after your earlier missions. Create a new file called tide.txt containing exactly "Patrol starts at 08:00" on its only line. Commit it:
git add tide.txt git commit -m "Set practice patrol time" git switch -c practice/later-patrol
On this new branch, change that line to "Patrol starts at 09:00", save, stage and commit. Then switch to main, change the same line to "Patrol starts at 10:00", save, stage and commit:
git add tide.txt git commit -m "Try nine oclock patrol" git switch main
After editing the line on main to 10:00:
git add tide.txt git commit -m "Try ten oclock patrol" git merge practice/later-patrol
Git should report a content conflict because both branches changed the same line differently. Open tide.txt: HEAD is the current branch side for this merge, and the other side is the branch being merged. Choose the intended final sentence, for example "Patrol starts at 09:30", and remove all <<<<<<<, ======= and >>>>>>> markers.
git add tide.txt git commit -m "Agree on nine thirty patrol" git status
Want to cancel before committing the resolution? git merge --abort is the escape route for this clean-start exercise. Conflicts can also involve renames or deletion; not every conflict is a choice between two lines. "Keep both" can create broken code.
Honu missionSuccess: tide.txt has one agreed sentence, no conflict markers, and status is clean. Keep this local exercise unpushed unless you choose to share it.

Recover with a new breadcrumb.

Reverse a commit while keeping history readable.

For a small local practice mistake, begin clean, append a disposable line to rescue-log.md, commit it, then reverse that ordinary commit:
git add rescue-log.md git commit -m "Practice a change we will undo" git log -1 --oneline git revert --no-edit HEAD git log -2 --oneline
Run revert only after the practice commit succeeded and you have confirmed it is the target. The original commit still exists, and the new revert commit removes its effect. On shared repos, consider making the reversal through a new branch and reviewed PR.
Reverting a merge is more specific. Git needs to know which parent is the baseline. git revert -m 1 MERGE_HASH keeps the first-parent perspective; it does not mean "always choose main". Inspect the merge and its parent order before using it. Squash merges produce an ordinary commit, which normally uses git revert COMMIT_HASH without -m.
GitHub may offer Revert on a merged PR to create a new reversing PR. The automatic route is not available in every situation. Read the proposed reversal and test it before merging. Later changes can conflict with a reversal, and reverting a merge affects how later merges see ancestry.
Do not delete .git, run reset --hard or force-push to solve an unfamiliar message. Save your own work, read git status and ask for a specific explanation. Reflog can help find recent local references, but it is not a promise that discarded edits or deleted repositories can be recovered.
Honu missionSuccess: the disposable line is gone and the log shows both the practice commit and its reversal. History tells the story honestly.

Your pocket command card.

Read status first. Replace placeholders deliberately.

git status # current state git diff # unstaged tracked edits git diff --staged # next commit contents git add FILE_NAME # stage named file git commit -m "Explain the change" # record staged snapshot git log --oneline --graph # inspect history git restore --staged FILE_NAME # unstage, keep edits git restore -- FILE_NAME # discard unstaged edit git show HASH:FILE_NAME # inspect committed file git switch -c feature/NAME # create and switch git switch main # return to main git merge feature/NAME # merge into current branch git fetch origin # download, do not integrate git pull --ff-only # update only if fast-forward git push # upload commits gh issue list # inspect open issues gh pr diff PR_NUMBER # inspect a PR gh pr checkout PR_NUMBER # fetch and switch to PR git merge --abort # cancel pending merge git revert HASH # reverse ordinary commit
restore discards unstaged edits; revert makes a new commit and can conflict. HASH, FILE_NAME, NAME and PR_NUMBER are placeholders. Never paste a command you do not understand into a project you care about.
Tiny routine: status → diff → stage specific files → staged diff → commit → verify → push. For collaboration: issue → branch → small change → PR → review → merge. Honu calls that "keeping your shell together."
Honu missionFinal project: add a new original rescue task on its own branch. Commit, inspect, and merge locally. Optional: publish it through a GitHub PR. Explain each step to a friend without reading the command card.

When the terminal gets dramatic.

A message is a clue, not a verdict.

Not a git repository: open the correct practice folder; do not initialize random parent folders. Author identity unknown: set the repo-local user.name and user.email. Nothing to commit: inspect status; perhaps you already committed, edited another copy, or forgot to save in your editor.
Empty diff: check git diff --staged and git status. Untracked files do not appear in plain diff. Branch not found: check the name; fetch, then use git branch -a for remote-tracking branches. Detached HEAD: return with git switch main, or first create a branch to preserve any new detached commits.
Push rejected: fetch and inspect the two histories. git pull --ff-only is appropriate when you have no competing local commits; otherwise it stops and you need a merge/rebase decision. Do not use force-push as the default fix. Origin already exists: inspect git remote -v instead of adding it twice.
Clone destination exists: choose a new folder name. gh permission/login error: inspect gh auth status, repository ownership and your organization's policies. CLI authentication does not give access to every repo. Draft PR cannot merge: review first, mark ready, and satisfy the repo's requirements.
Accidentally staged a file: git restore --staged FILE_NAME keeps your working edits. Accidentally committed a secret: rotate or revoke it first; ignoring or deleting it now does not remove old versions. Conflict after merge: resolve thoughtfully and commit, or abort the pending merge from a clean-start practice.
Ask for help with the exact error, your goal, git status and a sanitized diff. Remove credentials and private data. Do not share .git configuration blindly; remotes can contain sensitive URLs.
Honu missionWrite your own two-sentence explanation of one error you solved. Teaching it back is how a copied command becomes a skill.

Good guides leave good credits.

Sources, reuse and what your store purchase means.

This ChathoNU edition adapts ideas and material from the user-supplied git-guide-main companion guide, copyright 2026 NetworkChuck, distributed under the MIT License. ChathoNU adds the Honu rescue project, original practice missions, layout, explanations, prompt cards and verification. This is an independent adaptation; no endorsement or affiliation is implied.
The source attribution above is based on the supplied folder's LICENSE and README. The linked video was supplied as context, not re-hosted or bundled. The full original MIT notice is reproduced on the following page and included in the practice kit and download package.
The complete guide and practice kit are free at chathonu.com/guides/git-github. Optional Gumroad and Whop support copies cost $14.99 USD one-time and contain the same learning material. Buying one supports more Honu guides; the free edition requires no account or email.
Official references, checked November 18, 2026. Interfaces and installation routes can change. Local Git exercises are verified separately; GitHub account actions are not performed on the learner's behalf.
Git installation: https://git-scm.com/install
Git reference: https://git-scm.com/docs
Git restore: index and working tree: https://git-scm.com/docs/git-restore
GitHub CLI: create a repo: https://cli.github.com/manual/gh_repo_create
GitHub CLI: pull requests: https://cli.github.com/manual/gh_pr
Ignoring tracked and untracked files: https://docs.github.com/en/get-started/git-basics/ignoring-files
Removing sensitive data: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository
Merge conflicts: https://docs.github.com/en/pull-requests/reference/merge-conflicts
Git revert: https://git-scm.com/docs/git-revert
NetworkChuck video supplied as context: https://www.youtube.com/watch?v=c5TSRxrDEK8

Original source license

Preserved in full for the adapted source material.

MIT License Copyright (c) 2026 NetworkChuck Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keep exploring with Honu

Try our free AI Basics course, explore the AI coding tools guide, or ask Wednesday to explain a sanitized error.

Read the original MIT license

Want to support the next Honu guide?

Everything above stays free on ChathoNU. Optional store copies cost $14.99 USD one-time and contain the same learning material. They support Max and give you a copy in your store library.

Support on GumroadSupport on Whop

Stuck on a step? Send a message and say which one.