Jacobian Command Center โ€” aabad420/jcc

Git & GitHub Workflow

๐Ÿ’ป MacBook Air (local)  โ†”  โ˜๏ธ GitHub (remote)

๐Ÿ’ป MacBook Air ~/Documents/repos/jcc
GitHub github.com/aabad420/jcc โ˜๏ธ
Step 01 โ€” one time only
git clone
First time only. Downloads the JCC repo from GitHub to your Mac.
# Brings repo to ~/Documents/repos/jcc
git clone https://aabad420:$(op item get
  "GitHub Personal Access Token - JCC"
  --vault "Personal" --reveal --fields password)
  @github.com/aabad420/jcc.git
clone
โ†
GitHub โ€” source of truth
main branch lives here
Private repo. Nobody touches this directly. All changes go through PRs.
# github.com/aabad420/jcc
# main branch โ€” source of truth
# private repo โœ“ protected โœ“
โ†“
Step 02 โ€” every single time, no exceptions
cd into jcc โ†’ git pull
Muscle memory sequence. The moment you open Terminal and need to work on jcc โ€” cd in, git pull immediately. Don't skip this. Skipping it = stale code = merge conflicts later.
# Step 1 โ€” navigate into jcc
cd ~/Documents/repos/jcc

# Step 2 โ€” immediately pull before anything else
git pull

# That's it. You're synced. Ready to branch.
# git status optional โ€” pull already shows what changed
git pull
โ†
GitHub remote
Latest main comes down
git pull talks to GitHub and syncs any new commits to your local main. Both are now in sync โ€” safe to branch.
# GitHub jcc main โ†’ your local jcc main
# Both in sync โœ“
# Safe to branch now โœ“
โ†“
Step 03 โ€” local only
Create a Branch
Your branch is a copy of local main at this exact moment. Local main stays completely frozen from here โ€” it will NOT move until Step 09 when you git pull again.
# Already inside jcc from Step 02 โ€” no need to cd again
# Create + switch to new branch off fresh main
git checkout -b feature/jcc-add-network-configs

# Confirm which branch you're on
git branch
local only
โ†“
Step 04 โ€” local only, on your branch only
Do Your Work
All commits happen on your feature branch only. git commit does NOT touch local main โ€” it doesn't even know this is happening. Local main stays frozen.
# Open jcc repo in VS Code
code ~/Documents/repos/jcc

# Check what changed on your branch (local only)
git status

# Stage everything on your branch
git add .

# Snapshot saved on feature branch only
# local main is NOT touched by this command
git commit -m "jcc: add network config files for home lab"
local only
โ†“
State right now โ†’ ๐Ÿ”’ local main โ€” frozen โœ๏ธ local branch โ€” active ๐Ÿ”’ GitHub main โ€” frozen โฌ†๏ธ GitHub branch โ€” not pushed yet
โ†“
Step 05 โ€” sends to GitHub
Push Branch to GitHub
First push uses -u to link the branch. After that just git push.
# First push for this branch โ€” links it to GitHub
git push -u origin feature/jcc-add-network-configs

# Every push after that
git push
git push
โ†’
GitHub remote
Branch appears on GitHub
Your feature branch is now on GitHub. No PR yet โ€” just the branch sitting there ready.
# github.com/aabad420/jcc/tree/
# feature/jcc-add-network-configs
# Branch is up. Ready to open a PR.
โ†“
Step 06 โ€” optional CLI method
Open PR via GitHub CLI (gh)
Install gh once via Homebrew. Then open PRs without leaving Terminal. Power user move โ€” stick with GUI first until the flow is automatic.
# One time install
brew install gh
gh auth login

# Open a PR from current branch
gh pr create \
  --title "Add network configs to jcc" \
  --body "Added firewall and network config files"

# Open as draft (still WIP)
gh pr create --draft \
  --title "Add network configs to jcc"

# Check PR status from Terminal
gh pr status
gh pr list
open pr
โ†’
Step 06 โ€” GitHub UI method
Open PR via GitHub.com
This is what devs mean by "I have a PR ready" or "PR in draft." Most common method โ€” do this first until gh CLI feels natural.
# In the GitHub UI:
# 1. Go to github.com/aabad420/jcc
# 2. Click "Compare & pull request"
# 3. Title: "Add network configs to jcc"
# 4. Draft = still WIP
# 5. Ready for Review = send it
# 6. Submit the PR
โ†“
Step 07 โ€” if changes requested
Address Review Feedback
Reviewer asks for changes? Fix locally, commit, push. PR auto-updates on GitHub.
# Make your fixes in jcc, then:
git add .
git commit -m "jcc: fix PR feedback - update firewall rules"
git push

# PR at github.com/aabad420/jcc auto-updates
git push
โ†’
Step 07 โ€” GitHub UI
PR Review
Teammate reviews. Approves, comments, or requests changes. Quality gate before main.
# Reviewer options in GitHub UI:
# โœ… Approve
# ๐Ÿ’ฌ Comment
# ๐Ÿ”„ Request changes
โ†“
Step 08 โ€” CLI method (gh)
Merge PR via Terminal
If you opened the PR with gh, you can merge it from Terminal too. Keeps you in the flow without switching to the browser.
# Check PR is approved and ready
gh pr status

# Merge the PR from Terminal
gh pr merge --merge \
  --subject "Add network configs to jcc"

# feature/jcc-add-network-configs โ†’ main โœ“
merge
โ†’
Step 08 โ€” go to prod moment
Merge PR via GitHub.com
PR approved. Click Merge on GitHub. Branch folds into main. Equivalent of promoting to prod.
# In GitHub UI at github.com/aabad420/jcc:
# Click "Merge pull request"
# Confirm the merge
# feature/jcc-add-network-configs โ†’ main โœ“
โ†“
Step 09 โ€” the ONLY moment local main moves forward
Sync Local Main & Clean Up
This git pull is the one and only time local main gets updated. It was frozen since Step 02 โ€” now it finally syncs forward with the merged changes from GitHub.
# Get back to main
git checkout main

# Sync GitHub jcc main โ†’ local jcc main
git pull

# Delete branch locally
git branch -d feature/jcc-add-network-configs

# Delete branch on GitHub
git push origin --delete feature/jcc-add-network-configs

# Starting next feature? Go back to Step 02.
# cd ~/Documents/repos/jcc โ†’ git pull โ†’ branch
git pull
โ†
GitHub remote
Main is up to date
GitHub main has your merged changes. New source of truth. Start the cycle again for the next feature.
# main branch updated โœ“
# feature branch deleted โœ“
# Ready for next cycle ๐Ÿ”
Command Quick Reference โ€” Does It Talk to GitHub?
Command Talks to GitHub? What It Does
git statusโŒ NoShows local changes only โ€” your Mac, not GitHub
git add .โŒ NoStages all changed files locally
git commit -m "..."โŒ NoSaves a local snapshot โ€” nothing goes to GitHub yet
git branchโŒ NoLists your local branches
git checkout -b <name>โŒ NoCreates and switches to a new local branch
git log --onelineโŒ NoShows local commit history in a clean list
git pullโœ… YesGrabs latest changes from GitHub โ†’ syncs your local
git pushโœ… YesSends your local commits up to GitHub
git clone <url>โœ… YesFirst time only โ€” downloads a GitHub repo to your Mac
Full CLI Reference โ€” All Commands Run Hands-On
โš™๏ธ Git version control
git --versionCheck Git is installed and see the version
git config --global user.nameSet your global Git username
git config --global user.emailSet your global Git email
git config --global --listVerify all global Git config settings
git config pull.rebase falseSet pull strategy to merge not rebase
git initInitialize a brand new local Git repo
git clone <url>Download a GitHub repo to your Mac โ€” one time only
git statusCheck local changes โ€” does NOT talk to GitHub
git add <file>Stage a specific file for commit
git add .Stage all changed files at once
git commit -m "message"Save a local snapshot โ€” does NOT touch main or GitHub
git pushSend local commits up to GitHub
git push -u origin mainFirst push โ€” links local branch to GitHub remote
git pullSync GitHub main โ†’ local. Only way local main moves forward.
git pull origin main --allow-unrelated-historiesForce pull when repos have different starting points
git branch -m mainRename current branch to main
git remote add origin <url>Link local repo to a GitHub remote for the first time
git remote set-url origin <url>Update the GitHub remote URL on an existing repo
๐Ÿ’ป Terminal Basics mac cli
pwdPrint working directory โ€” shows where you are
lsList files and folders in current directory
ls -laList all files including hidden ones with details
cdNavigate to home directory (~)
cd <folder>Navigate into a specific folder
cd ..Go up one folder level
mkdir -p <folder>Create a folder and parent folders if needed
cat <file>Read and display contents of a file
nano <file>Open a file in the Terminal text editor
echo "text" > file.mdCreate a file and write text into it
brew --versionConfirm Homebrew is installed
wget <url>Download a file from the internet via Terminal
๐Ÿ” 1Password CLI credential management
op --versionConfirm 1Password CLI is installed
eval Sign in โ€” required before any op commands
op account addAdd a 1Password account to the CLI
op vault listList all vaults in your 1Password account
op item createCreate a new item in 1Password from Terminal
op item get "<name>" --vault "<vault>" --reveal --fields passwordRetrieve a secret securely โ€” injects PAT into git clone
๐Ÿ”‘ SSH remote access
ssh root@<IP>SSH directly into a remote server as root
ssh -J jumphost root@<IP>SSH through a jump host to reach a private server
๐Ÿ  Home Assistant home automation
ha core checkValidate Home Assistant config before restarting
ha core restartRestart the Home Assistant core service
ha core logsView live Home Assistant logs for troubleshooting
ha supervisor infoShow supervisor status and version info
๐ŸŒ Networking diagnostics
ping <IP>Test connectivity to an IP address or hostname
ipconfig getifaddr en0Get your Mac local IP address on the network
GitHub CLI (gh) โ€” Sequential Order
GitHub CLI (gh) Commands โ€” In the Order You Use Them install once ยท use every session
Step 01 โ€” one time brew install gh
Install GitHub CLI via Homebrew One time only. Gives you the gh command in Terminal so you never have to open the browser for PR tasks.
Step 02 โ€” one time gh auth login
Authenticate gh with your GitHub account One time setup. Links the gh CLI to your aabad420 GitHub account so it can act on your behalf.
Step 03 โ€” after git push gh pr create --title "..." --body "..."
Open a Pull Request from Terminal Run after pushing your branch. Skip the browser entirely โ€” PR is created on GitHub instantly.
Step 03 โ€” optional gh pr create --draft --title "..."
Open a PR in Draft mode Use when you are still working on it and not ready for review. Signals WIP to teammates.
Step 04 โ€” check status gh pr status
See status of your open PRs Check if your PR is approved, has review comments, or is still pending. No browser needed.
Step 04 โ€” view all gh pr list
List all open PRs in the repo See every open PR at a glance โ€” useful when managing multiple branches or reviewing others work.
Step 05 โ€” once approved gh pr merge --merge --subject "..."
Merge an approved PR from Terminal PR is approved and ready. Merge it without touching the browser. Feature branch folds into main.
Learning Notes โ€” Day 0 vs Day 1
๐Ÿ““ What Was Different โ€” Direct Push vs Full PR Workflow May 16 โ†’ May 17, 2026
โŒ Day 0 โ€” Learning Mode (Direct to Main)
# No branch โ€” worked directly on main
git add .
git commit -m "Initial commit"
git push -u origin main
# Went straight to main. No PR.
Fine for learning the basics โ€” but not how professionals work. No branch, no review, no audit trail.
โœ… Day 1 โ€” Professional Mode (Full PR Workflow)
git pull
git checkout -b feature/jcc-...
git add .
git commit -m "..."
git push -u origin feature/jcc-...
# Open PR โ†’ Review โ†’ Merge
git checkout main
git pull
git branch -d feature/jcc-...
git push origin --delete feature/jcc-...
Branch โ†’ commit โ†’ push branch โ†’ PR โ†’ merge โ†’ sync โ†’ cleanup. The full professional loop.
What Day 0 โ€” Direct Push Day 1 โ€” PR Workflow
Worked directly on main โŒ feature branch โœ…
Pull Request created No โŒ Yes โœ…
Code review possible No โŒ Yes โœ…
Audit trail No โŒ Yes โœ…
Main branch protected No โŒ Yes โœ…
Netlify auto-deploy triggered No โŒ Yes โœ…
๐Ÿ” Reading a Pull Request โ€” What Each Tab Means GitHub UI
Conversation Tab
The Timeline
Read top to bottom โ€” chronological order. PR opened โ†’ commits โ†’ bot reactions โ†’ review comments โ†’ merge โ†’ branch deleted. Full audit trail of everything that happened.
Commits Tab
Every Commit in the PR
Lists all commits that are part of this PR. Each has a hash, message, and author. Shows the history of work done on the branch.
Files Changed Tab
The Diff
Shows exactly what changed. Red lines = removed. Green lines = added. White lines = unchanged context. Reviewers read this โ€” not the whole file โ€” just what changed.
Checks Tab
Automated Tests & Deploys
Shows results of any automated checks โ€” Netlify deploy previews, CI/CD pipelines, tests. Your Netlify bot showed up here automatically when the PR was opened.
Merge Options
3 Ways to Merge
Merge pull request = keeps all commits. Squash and merge = combines all commits into one clean commit. Rebase and merge = replays commits on top of main. Most teams use Squash.
Delete Branch Button
Same as git push --delete
After merging GitHub shows a Delete branch button. One click does what two Terminal commands do โ€” deletes the branch both locally on GitHub and remotely.