Git Worktree: How to Work on Multiple Branches at Once

You鈥檙e three files into a feature branch, nothing committed, when a teammate pings you about a null-pointer crash in production. The usual move is git stash, check out main, fix it, push, then git stash pop and hope nothing in your half-finished feature depended on the files you switched away from. git worktree skips the shuffle. It checks out the hotfix branch into a second folder, next to your feature branch, with both backed by the same repository. ...

October 24, 2026 路 5 min 路 974 words 路 SpaghettiCoder

Git Reset vs Revert vs Restore: How to Undo Changes

Run git reset --hard on a commit your team already pulled and you鈥檝e just made your history disagree with theirs. Run git revert on a typo you haven鈥檛 pushed and you鈥檝e added a pointless commit to the log. Git has four undo commands, restore, reset, commit --amend and revert, and they are not interchangeable. Pick the wrong one and it either does nothing or does far more than you wanted. ...

October 3, 2026 路 7 min 路 1286 words 路 SpaghettiCoder

SSH Tunneling: Local, Remote, and Dynamic Port Forwarding

How do you reach a database that only listens on localhost? A Postgres instance on a remote server binds to 127.0.0.1 on purpose. Nothing on the network can reach it, only processes running on that same box. Your laptop is not that box, so psql -h remote-server -p 5432 fails before it gets anywhere near authentication. Opening the port to the world defeats the reason it was bound to loopback in the first place. ...

September 24, 2026 路 7 min 路 1416 words 路 SpaghettiCoder

How to Cache Dependencies in GitHub Actions

A workflow that runs npm ci on every push downloads the same few hundred packages from the registry each time, even when the lockfile hasn鈥檛 changed in a week. On a project with a real dependency tree that鈥檚 a minute or two gone before the first test starts, and you pay it again on every push and every pull request. actions/cache keeps those downloads between runs and hands them back when nothing relevant has changed. ...

September 23, 2026 路 6 min 路 1167 words 路 SpaghettiCoder

How to Expose a Local Server with Cloudflare Tunnel

Why nobody outside your network can reach localhost A webhook provider needs a URL it can POST to, and your server is sitting on localhost:3000. Or a teammate wants to click through the branch you鈥檙e running, or your phone needs to hit the dev server to check a layout. The server is up. Nothing outside your network can reach it. Port forwarding on your router would work, but it exposes your home IP and needs admin access you often don鈥檛 have. Cloudflare Tunnel takes the other route. cloudflared, a small daemon you run next to your server, opens an outbound connection to Cloudflare鈥檚 edge, and Cloudflare sends traffic back through it. You open no inbound port and you don鈥檛 need a public IP. ...

September 23, 2026 路 7 min 路 1383 words 路 SpaghettiCoder

How to Use Git Bisect to Find a Broken Commit

The test suite has been green for three weeks. Today npm test fails on an assertion that has nothing to do with what you just changed, and git log v1.4.0..HEAD shows 340 commits from four people since the last release anyone is sure worked. Reading every diff costs you a day. Checking out commits at random is faster and still not a plan. git bisect turns that into a binary search. You give it one commit you know is good and one you know is bad; it checks out the commit halfway between them and waits while you test that single commit and report back. Each answer halves the range. 340 commits resolve in at most 9 tests, since 2^9 = 512. ...

September 22, 2026 路 6 min 路 1104 words 路 SpaghettiCoder

What Is DNS and How Domain Name Resolution Works

What DNS actually does on every request Every request to example.com starts with a lookup that has nothing to do with your application: something has to turn that name into an IP address before a single TCP packet leaves the machine. That translation is DNS, the Domain Name System, and it runs on every request, whether the client is a browser, curl, or a backend service calling another backend by hostname. ...

September 21, 2026 路 7 min 路 1445 words 路 SpaghettiCoder

What Is TLS and How HTTPS Encryption Works

What TLS actually protects on an HTTPS connection Load a page over plain http:// on a network you don鈥檛 control, an airport or a coffee-shop router, and everything you send travels as readable text. The URL path, the cookies, the form fields, the password in a login POST: anyone on that network with a packet sniffer reads it as it goes past. TLS, Transport Layer Security, is the protocol that stops that. It sits between TCP and the application protocol, so by the time HTTP starts talking, the connection is already encrypted and tied to a verified server identity. HTTPS is HTTP run over that connection instead of a plain one. ...

September 20, 2026 路 10 min 路 1956 words 路 SpaghettiCoder

What Is a Message Queue and How to Use One

A checkout endpoint that resizes a product image, sends a confirmation email, and updates a recommendation engine before returning 200 OK is only as fast as its slowest step. If any one of them times out, the whole request fails. A message queue lets the endpoint hand that work off as messages and return immediately, while separate workers pick them up on their own schedule. What a message queue actually does A message queue sits between two parts of a system that don鈥檛 need to run at the same moment. A producer publishes a message describing work to be done. The queue holds it. A consumer picks it up, processes it, and acknowledges it. The two never talk to each other directly. ...

September 18, 2026 路 7 min 路 1297 words 路 SpaghettiCoder

What Is Terraform and How Infrastructure as Code Works

Every cloud resource you have ever clicked into existence in a web console (a VM, a load balancer, a DNS record) can also be described in a text file and created by running one command. The file lives in git, gets reviewed in a pull request, and reproduces the same setup on a second account without anyone remembering which nine settings they changed by hand. That is what Terraform does. ...

September 17, 2026 路 7 min 路 1487 words 路 SpaghettiCoder