<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Tools &amp; Tips on entangledDEV</title>
        <link>/categories/tools--tips/</link>
        <description>Recent content in Tools &amp; Tips on entangledDEV</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <lastBuildDate>Sun, 01 Feb 2026 00:09:25 -0600</lastBuildDate><atom:link href="/categories/tools--tips/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>Git How-Tos I Reach For Daily Work</title>
            <link>/p/git-how-tos-i-reach-for-daily-work/</link>
            <pubDate>Mon, 27 Oct 2025 17:42:48 +0000</pubDate>
            <guid>/p/git-how-tos-i-reach-for-daily-work/</guid>
            <description>&lt;p&gt;This is my running log of Git moves I reach for when I do work. Each mini-how-to includes the exact commands plus a quick note on what to watch for.&lt;/p&gt;&#xA;&lt;h2 id=&#34;squash-multiple-commits-into-one&#34;&gt;&lt;a href=&#34;#squash-multiple-commits-into-one&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Squash Multiple Commits Into One&#xA;&lt;/h2&gt;&lt;p&gt;Use interactive rebase to collapse the last &lt;em&gt;n&lt;/em&gt; commits into a single, tidy changeset.&lt;/p&gt;&#xA;&lt;p&gt;Optional safety: create a backup branch before rebasing:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git branch backup/feature-branch-before-squash&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git rebase -i HEAD~3&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Replace &lt;code&gt;3&lt;/code&gt; with however many commits you want to include, counting the current &lt;code&gt;HEAD&lt;/code&gt; as part of that total. &lt;code&gt;HEAD&lt;/code&gt; refers to the current commit, &lt;code&gt;HEAD~1&lt;/code&gt; to its parent, &lt;code&gt;HEAD~2&lt;/code&gt; to the one before that, and so on. When you run &lt;code&gt;git rebase -i HEAD~3&lt;/code&gt;, Git lists the last three commits including &lt;code&gt;HEAD&lt;/code&gt;. Run &lt;code&gt;git log --oneline&lt;/code&gt; to count backward until you reach the oldest commit you intend to squash.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Tip: Use &lt;code&gt;HEAD~3^&lt;/code&gt; if you need to include the fourth commit in the interactive list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;For example, if your history looks like this (newest first):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;a1b2c3 (HEAD)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;d4e5f6&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;g7h8i9&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;j0k1l2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The command &lt;code&gt;git rebase -i HEAD~3&lt;/code&gt; opens the editor with:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pick j0k1l2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pick g7h8i9&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pick d4e5f6&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the editor:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Leave the first commit as &lt;code&gt;pick&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Change the rest to &lt;code&gt;squash&lt;/code&gt; (or &lt;code&gt;s&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Save, then compose the final commit message&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;If conflicts appear, resolve them and resume with &lt;code&gt;git rebase --continue&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To abort the squash at any point, run:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git rebase --abort&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;force-push-after-squashing&#34;&gt;&lt;a href=&#34;#force-push-after-squashing&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Force Push After Squashing&#xA;&lt;/h2&gt;&lt;p&gt;Once history changes, update the remote branch.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git push --force-with-lease origin feature/my-branch&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;--force-with-lease&lt;/code&gt; protects teammates by refusing to overwrite work you haven’t fetched.&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-local-repo-and-wire-up-a-remote&#34;&gt;&lt;a href=&#34;#create-a-local-repo-and-wire-up-a-remote&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Create a Local Repo and Wire Up a Remote&#xA;&lt;/h2&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkdir my-project &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; my-project&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git init&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# add files, then commit&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git add .&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git commit -m &lt;span class=&#34;s2&#34;&gt;&amp;#34;Initial commit&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git remote add origin git@github.com:username/my-project.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git push -u origin main&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the remote is empty, &lt;code&gt;main&lt;/code&gt; (or &lt;code&gt;master&lt;/code&gt;) becomes the default branch once you push with &lt;code&gt;-u&lt;/code&gt;. Double-check the URL format (&lt;code&gt;git@&lt;/code&gt; for SSH, &lt;code&gt;https://&lt;/code&gt; for HTTPS) before adding the remote.&lt;/p&gt;&#xA;&lt;h2 id=&#34;track-a-remote-branch-locally&#34;&gt;&lt;a href=&#34;#track-a-remote-branch-locally&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Track a Remote Branch Locally&#xA;&lt;/h2&gt;&lt;p&gt;When you create a local branch that should follow an existing remote branch, set the upstream explicitly.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git switch -c feature/api-integration origin/feature/api-integration&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# or, if branch already exists locally&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git branch --set-upstream-to&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;origin/feature/api-integration&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now &lt;code&gt;git pull&lt;/code&gt; and &lt;code&gt;git push&lt;/code&gt; know which remote branch to use. If Git complains that the remote ref is missing, fetch it first (&lt;code&gt;git fetch origin feature/api-integration&lt;/code&gt;) and rerun the command.&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-branch-and-push-it-upstream&#34;&gt;&lt;a href=&#34;#create-a-branch-and-push-it-upstream&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Create a Branch and Push It Upstream&#xA;&lt;/h2&gt;&lt;p&gt;Shortcut to create a branch, commit, and publish it with upstream tracking in one go.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git switch -c feature/search-bar&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git commit -am &lt;span class=&#34;s2&#34;&gt;&amp;#34;Add search bar styles&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git push -u origin feature/search-bar&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;-u&lt;/code&gt; (or &lt;code&gt;--set-upstream&lt;/code&gt;) wires the remote for future pushes. Remember that &lt;code&gt;git commit -am&lt;/code&gt; only stages files Git already tracks—run &lt;code&gt;git add&lt;/code&gt; first if you created new files.&lt;/p&gt;&#xA;&lt;h2 id=&#34;sync-with-the-latest-from-main-without-merge-commits&#34;&gt;&lt;a href=&#34;#sync-with-the-latest-from-main-without-merge-commits&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Sync With the Latest From Main Without Merge Commits&#xA;&lt;/h2&gt;&lt;p&gt;Rebase your current branch onto &lt;code&gt;main&lt;/code&gt; to replay your commits on top of the latest state.&lt;/p&gt;&#xA;&lt;p&gt;Optional safety: create a backup before rebasing:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git branch backup/feature-search-bar-before-rebase&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol&gt;&#xA;&lt;li&gt;Make sure you have no pending edits: &lt;code&gt;git status -sb&lt;/code&gt; should report a clean tree.&lt;/li&gt;&#xA;&lt;li&gt;Update &lt;code&gt;main&lt;/code&gt; so you are rebasing onto the real latest code.&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git switch main&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git pull --ff-only origin main&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;Return to your feature branch (replace with your branch name).&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git switch feature/search-bar&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;Replay your commits on top of the freshly updated &lt;code&gt;main&lt;/code&gt;.&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git rebase main&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;⚠️ &lt;strong&gt;Rebase pointer:&lt;/strong&gt;&lt;br&gt;&#xA;In merges: ours = current branch, theirs = incoming.&lt;br&gt;&#xA;In rebases: ours = target branch, theirs = replayed commit.&lt;br&gt;&#xA;Pick the pieces you need, &lt;code&gt;git add&lt;/code&gt; each resolved file, and continue with &lt;code&gt;git rebase --continue&lt;/code&gt;.&lt;br&gt;&#xA;If the rebase turns chaotic, bail out with &lt;code&gt;git rebase --abort&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Once the history looks right, rerun your tests and publish the new linear history:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git push --force-with-lease origin feature/search-bar&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you prefer to preserve merge commits instead, use &lt;code&gt;git merge origin/main&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;rebase-onto-the-remote-version-of-your-branch&#34;&gt;&lt;a href=&#34;#rebase-onto-the-remote-version-of-your-branch&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Rebase Onto the Remote Version of Your Branch&#xA;&lt;/h2&gt;&lt;p&gt;When teammates update the remote feature branch, pull those commits in and resolve conflicts locally.&lt;/p&gt;&#xA;&lt;p&gt;Optional safety: create a backup before rebasing:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git branch backup/feature-payment-before-rebase&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol&gt;&#xA;&lt;li&gt;Ensure a clean tree first: &lt;code&gt;git status -sb&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Update your knowledge of the remote branch.&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git fetch origin feature/payment&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;Switch to your local branch that you want to replay.&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git switch feature/payment&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;Rebase onto the remote tracking branch you fetched.&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git rebase origin/feature/payment&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;⚠️ &lt;strong&gt;Rebase pointer:&lt;/strong&gt;&lt;br&gt;&#xA;In merges: ours = current branch, theirs = incoming.&lt;br&gt;&#xA;In rebases: ours = target branch, theirs = replayed commit.&lt;br&gt;&#xA;Merge the pieces you want, stage them with &lt;code&gt;git add&lt;/code&gt;, and continue (&lt;code&gt;git rebase --continue&lt;/code&gt;).&lt;br&gt;&#xA;If the rebase turns chaotic, bail out with &lt;code&gt;git rebase --abort&lt;/code&gt;.&lt;br&gt;&#xA;Alternatively, if your upstream is set, you can pull and rebase in one step:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git pull --rebase&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After the rebase, rerun tests and share the rewritten history safely:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git push --force-with-lease origin feature/payment&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;cherry-pick-a-fix-onto-another-branch&#34;&gt;&lt;a href=&#34;#cherry-pick-a-fix-onto-another-branch&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Cherry-Pick a Fix Onto Another Branch&#xA;&lt;/h2&gt;&lt;p&gt;Grab a single commit and apply it elsewhere.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git switch release/1.2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git cherry-pick &amp;lt;commit-sha&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If conflicts arise, fix them, &lt;code&gt;git add&lt;/code&gt; the files, and run &lt;code&gt;git cherry-pick --continue&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For multiple commits, cherry-pick a range (the upper bound is exclusive):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git cherry-pick A..B&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;&#xA;&lt;p&gt;Tip: Use &lt;code&gt;A^..B&lt;/code&gt; if you want to include commit &lt;code&gt;A&lt;/code&gt; itself.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h2 id=&#34;quick-patch-from-a-file-diff&#34;&gt;&lt;a href=&#34;#quick-patch-from-a-file-diff&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Quick Patch From a File Diff&#xA;&lt;/h2&gt;&lt;p&gt;Generate a patch for one file and drop it into another branch or repo.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git diff main..feature/payment checkout.swift &amp;gt; checkout.patch&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git switch hotfix/payment-crash&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git apply checkout.patch&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Review the applied changes before committing.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;git apply&lt;/code&gt; only affects the working tree; follow up with &lt;code&gt;git add&lt;/code&gt; and &lt;code&gt;git commit&lt;/code&gt; once you confirm the patch looks right.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Tip: Run &lt;code&gt;git am checkout.patch&lt;/code&gt; instead if you want to preserve the original author and commit message from the patch.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h2 id=&#34;merge-main-into-your-branch-keep-the-merge-commit&#34;&gt;&lt;a href=&#34;#merge-main-into-your-branch-keep-the-merge-commit&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Merge Main Into Your Branch (Keep the Merge Commit)&#xA;&lt;/h2&gt;&lt;p&gt;If your team relies on merge commits for context, integrate the latest &lt;code&gt;main&lt;/code&gt; without rewriting history.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git fetch origin&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git merge --no-ff origin/main&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Resolve conflicts, run the test suite, and let Git create the merge commit message. &lt;code&gt;--no-ff&lt;/code&gt; retains the merge node even when a fast-forward is possible, preserving the branch narrative.&lt;/p&gt;&#xA;&lt;h2 id=&#34;see-what-changed-between-two-branches&#34;&gt;&lt;a href=&#34;#see-what-changed-between-two-branches&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;See What Changed Between Two Branches&#xA;&lt;/h2&gt;&lt;p&gt;Compare your feature branch to &lt;code&gt;main&lt;/code&gt;, highlighting only the files or commits that differ.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git log --oneline main..feature/billing&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git diff --stat main...feature/billing&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Two dots (&lt;code&gt;..&lt;/code&gt;) show unique commits; three dots (&lt;code&gt;...&lt;/code&gt;) reveal files that diverged from the common ancestor.&lt;/p&gt;&#xA;&lt;h2 id=&#34;undo-the-last-commit-keep-changes&#34;&gt;&lt;a href=&#34;#undo-the-last-commit-keep-changes&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Undo the Last Commit (Keep Changes)&#xA;&lt;/h2&gt;&lt;p&gt;Keep your working tree but remove the most recent commit.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git reset --soft HEAD~1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;HEAD&lt;/code&gt; is the current commit, so &lt;code&gt;HEAD~1&lt;/code&gt; targets the one before it. The changes remain staged. To unstage but keep edits, use &lt;code&gt;git reset --mixed HEAD~1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;recover-work-you-thought-was-gone&#34;&gt;&lt;a href=&#34;#recover-work-you-thought-was-gone&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Recover Work You Thought Was Gone&#xA;&lt;/h2&gt;&lt;p&gt;If a commit vanished after a reset or rebase, scan the reflog.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git reflog&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can use &lt;code&gt;git show &amp;lt;reflog-sha&amp;gt;&lt;/code&gt; to inspect the commit before checking it out.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git switch --detach &amp;lt;reflog-sha&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Create a new branch from that SHA to rescue the work: &lt;code&gt;git switch -c rescue/forgotten &amp;lt;sha&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;stash-selective-files&#34;&gt;&lt;a href=&#34;#stash-selective-files&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Stash Selective Files&#xA;&lt;/h2&gt;&lt;p&gt;Avoid stashing the whole tree by selecting specific paths.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git stash push -- src/HomeView.swift&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git stash list&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git stash pop&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Combine with &lt;code&gt;--keep-index&lt;/code&gt; to stash only unstaged changes.&#xA;Stashes are stored in order; use &lt;code&gt;git stash list&lt;/code&gt; to view entries and &lt;code&gt;git stash pop stash@{1}&lt;/code&gt; to apply a specific one.&lt;/p&gt;&#xA;&lt;h2 id=&#34;clean-untracked-files-safely&#34;&gt;&lt;a href=&#34;#clean-untracked-files-safely&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Clean Untracked Files Safely&#xA;&lt;/h2&gt;&lt;p&gt;Preview deletions before scrubbing untracked files and directories.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clean -nd&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clean -fd&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;-n&lt;/code&gt; performs a dry run; &lt;code&gt;-f&lt;/code&gt; is required to delete, and &lt;code&gt;-d&lt;/code&gt; includes directories.&#xA;Double-check the dry-run output carefully—&lt;code&gt;git clean&lt;/code&gt; is irreversible once it runs with &lt;code&gt;-f&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;revert-a-commit-that-already-hit-main&#34;&gt;&lt;a href=&#34;#revert-a-commit-that-already-hit-main&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Revert a Commit That Already Hit Main&#xA;&lt;/h2&gt;&lt;p&gt;Create a new commit that undoes a previous one (keeps history intact).&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git revert &amp;lt;commit-sha&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Grab the commit SHA from &lt;code&gt;git log --oneline&lt;/code&gt;. If the revert itself fails because of conflicts, resolve them, &lt;code&gt;git add&lt;/code&gt; the files, and run &lt;code&gt;git revert --continue&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Tip: Need to revert several commits in one go? Use &lt;code&gt;git revert -n &amp;lt;sha1&amp;gt; &amp;lt;sha2&amp;gt; ...&lt;/code&gt; to stage the reversions and commit once at the end.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h2 id=&#34;rename-a-branch-locally-and-remotely&#34;&gt;&lt;a href=&#34;#rename-a-branch-locally-and-remotely&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Rename a Branch Locally and Remotely&#xA;&lt;/h2&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git branch -m old-name new-name&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git push origin --delete old-name&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git push -u origin new-name&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the branch is protected, you may need admin permissions (or to lift protection temporarily) before deleting it remotely. Afterwards, clean up stale references locally:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git fetch --prune&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Anyone else using the old branch should do the same and check out the new name.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;I add to this page whenever I find myself repeating a Git flow. If you’re reading along and need another scenario covered, let me know and I’ll expand the list.&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>Inspecting your network traffic in Apple Platforms</title>
            <link>/p/inspecting-your-network-traffic-in-apple-platforms/</link>
            <pubDate>Fri, 03 Oct 2025 17:21:27 +0000</pubDate>
            <guid>/p/inspecting-your-network-traffic-in-apple-platforms/</guid>
            <description>&lt;p&gt;Debugging HTTPS calls on iOS and iPadOS usually means reaching for a TLS proxy that can show you encrypted payloads. Charles Proxy remains a reliable option because it integrates with Apple devices, supports on-the-fly rewriting, and lets you archive sessions for later analysis. This guide walks through the minimal setup to get your device routing traffic through Charles without breaking App Transport Security (ATS).&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;&lt;a href=&#34;#prerequisites&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Prerequisites&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;Charles Proxy 4.6 or newer installed on your Mac.&lt;/li&gt;&#xA;&lt;li&gt;The iOS or iPadOS device connected to the same Wi‑Fi network as the Mac running Charles.&lt;/li&gt;&#xA;&lt;li&gt;Developer access to the app you are testing so you can safely tweak networking settings if needed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;configure-the-wifi-proxy-on-the-device&#34;&gt;&lt;a href=&#34;#configure-the-wifi-proxy-on-the-device&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Configure the Wi‑Fi proxy on the device&#xA;&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;Open &lt;strong&gt;Settings → Wi‑Fi&lt;/strong&gt; on your device and tap the &lt;code&gt;ℹ︎&lt;/code&gt; icon next to the active network.&lt;/li&gt;&#xA;&lt;li&gt;Scroll to &lt;strong&gt;Configure Proxy&lt;/strong&gt; and choose &lt;strong&gt;Manual&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Enter your Mac&amp;rsquo;s local IP address in &lt;strong&gt;Server&lt;/strong&gt;. You can find it in &lt;em&gt;System Settings → Network&lt;/em&gt; or by running &lt;code&gt;ipconfig getifaddr en0&lt;/code&gt; on macOS.&lt;/li&gt;&#xA;&lt;li&gt;Set &lt;strong&gt;Port&lt;/strong&gt; to &lt;code&gt;8888&lt;/code&gt; (Charles&amp;rsquo; default) and leave &lt;strong&gt;Authentication&lt;/strong&gt; off unless you enabled it in Charles.&lt;/li&gt;&#xA;&lt;li&gt;Tap &lt;strong&gt;Save&lt;/strong&gt;. Traffic now routes through your Mac for that Wi‑Fi network only.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Keep Charles open; if the proxy stops listening, iOS calls will fail immediately with &lt;code&gt;NSURLErrorCannotConnectToHost&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;install-and-trust-the-charles-ssl-certificate&#34;&gt;&lt;a href=&#34;#install-and-trust-the-charles-ssl-certificate&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Install and trust the Charles SSL certificate&#xA;&lt;/h2&gt;&lt;p&gt;Charles needs to present its own certificate so it can decrypt HTTPS. Apple treats any custom certificate as untrusted until you explicitly approve it.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;On the device, open &lt;strong&gt;Safari&lt;/strong&gt; and navigate to &lt;code&gt;https://chls.pro/ssl&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Safari downloads a configuration profile and shows an &lt;em&gt;Profile Downloaded&lt;/em&gt; banner. Tap it or go to &lt;strong&gt;Settings → General → VPN &amp;amp; Device Management&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Under &lt;strong&gt;Downloaded Profile&lt;/strong&gt;, select &lt;strong&gt;Charles Proxy CA&lt;/strong&gt; and tap &lt;strong&gt;Install&lt;/strong&gt;. Confirm with your passcode and approve the warning prompts.&lt;/li&gt;&#xA;&lt;li&gt;Navigate to &lt;strong&gt;Settings → General → About → Certificate Trust Settings&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Under &lt;strong&gt;Enable Full Trust For Root Certificates&lt;/strong&gt;, toggle on &lt;strong&gt;Charles Proxy CA&lt;/strong&gt; and confirm. Without this step, every HTTPS connection will fail due to trust errors.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Once trusted, Charles can decrypt traffic for domains that permit re-signing. ATS exceptions are unnecessary unless the app pins certificates or forbids proxies.&lt;/p&gt;&#xA;&lt;h2 id=&#34;verify-the-capture&#34;&gt;&lt;a href=&#34;#verify-the-capture&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Verify the capture&#xA;&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;In Charles, hit the &lt;strong&gt;Start Recording&lt;/strong&gt; button (red circle). Leave &lt;strong&gt;Proxy → macOS Proxy&lt;/strong&gt; off when you only care about physical devices; toggle it on if you also want macOS apps or simulators to route through Charles.&lt;/li&gt;&#xA;&lt;li&gt;Launch your app and repeat the network flow you want to inspect.&lt;/li&gt;&#xA;&lt;li&gt;Requests should stream into Charles&amp;rsquo; session list. Double-click an entry to view request headers, response payloads, and TLS information.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;strong&gt;Tools → SSL Proxying Settings&lt;/strong&gt; to add specific hosts if Charles reports &lt;em&gt;SSL handshake failed&lt;/em&gt;. Add domains with wildcards (for example, &lt;code&gt;api.example.com&lt;/code&gt; or &lt;code&gt;*.example.com&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;If your traceroute stays empty, confirm the device still uses the same Wi‑Fi network and that no VPN profiles override your proxy settings.&lt;/p&gt;&#xA;&lt;h2 id=&#34;troubleshooting-tips&#34;&gt;&lt;a href=&#34;#troubleshooting-tips&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Troubleshooting tips&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Certificate pinning&lt;/strong&gt;: Apps that implement SSL pinning will reject Charles&amp;rsquo; certificate. Disable pinning in a debug build or use a build flavor without pinning to capture traffic.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;HTTP/3 traffic&lt;/strong&gt;: Charles downgrades HTTP/3 to HTTP/2. If your API strictly requires QUIC, test with Apple&amp;rsquo;s PacketLogger or consider Proxyman/mitmproxy with HTTP/3 support.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Background sessions&lt;/strong&gt;: Background &lt;code&gt;URLSession&lt;/code&gt; traffic may not route through the proxy when the app is suspended. Keep the screen awake or use Instruments&amp;rsquo; HTTP template for background captures.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Different networks&lt;/strong&gt;: Switching Wi‑Fi networks clears the proxy configuration. Re-apply the manual proxy after every network change.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;clean-up-when-finished&#34;&gt;&lt;a href=&#34;#clean-up-when-finished&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Clean up when finished&#xA;&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;Return to &lt;strong&gt;Settings → Wi‑Fi → (ℹ︎)&lt;/strong&gt; and set &lt;strong&gt;Configure Proxy&lt;/strong&gt; back to &lt;strong&gt;Off&lt;/strong&gt; (or &lt;strong&gt;Automatic&lt;/strong&gt;).&lt;/li&gt;&#xA;&lt;li&gt;In &lt;strong&gt;Settings → General → About → Certificate Trust Settings&lt;/strong&gt;, disable the &lt;strong&gt;Charles Proxy CA&lt;/strong&gt; toggle.&lt;/li&gt;&#xA;&lt;li&gt;Optionally remove the profile from &lt;strong&gt;VPN &amp;amp; Device Management&lt;/strong&gt; to keep the device&amp;rsquo;s trust store clean.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Resetting both the proxy and certificate ensures future HTTPS requests use your production trust chain and keeps users from accidentally routing through a dormant proxy.&lt;/p&gt;&#xA;&lt;p&gt;With these steps in place you can capture, inspect, and replay network flows directly from real devices, which is invaluable when simulator behavior diverges from field reports.&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>VSCode Dev Container Configurations</title>
            <link>/p/vscode-dev-container-configurations/</link>
            <pubDate>Tue, 21 May 2024 00:46:23 +0000</pubDate>
            <guid>/p/vscode-dev-container-configurations/</guid>
            <description>&lt;p&gt;VSCode + Dev Containers are a great way to create custom environments without modifying our actual system.&lt;/p&gt;&#xA;&lt;p&gt;They provide a consistent development environment, ensure dependencies are managed correctly, and make it easy to share setups with your team.&lt;/p&gt;&#xA;&lt;p&gt;Here are some configurations you can use to create them.&lt;/p&gt;&#xA;&lt;h1 id=&#34;vapor&#34;&gt;&lt;a href=&#34;#vapor&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Vapor&#xA;&lt;/h1&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Swift&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;#34;image&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;swift:latest&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;#34;features&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nt&#34;&gt;&amp;#34;ghcr.io/devcontainers/features/common-utils:2&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nt&#34;&gt;&amp;#34;installZsh&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;false&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nt&#34;&gt;&amp;#34;username&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;vscode&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nt&#34;&gt;&amp;#34;userUid&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;1000&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nt&#34;&gt;&amp;#34;userGid&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;1000&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nt&#34;&gt;&amp;#34;upgradePackages&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;false&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nt&#34;&gt;&amp;#34;ghcr.io/devcontainers/features/git:1&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nt&#34;&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;os-provided&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nt&#34;&gt;&amp;#34;ppa&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;false&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;#34;runArgs&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;s2&#34;&gt;&amp;#34;--cap-add=SYS_PTRACE&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;s2&#34;&gt;&amp;#34;--security-opt&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;s2&#34;&gt;&amp;#34;seccomp=unconfined&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;#34;customizations&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nt&#34;&gt;&amp;#34;vscode&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nt&#34;&gt;&amp;#34;settings&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;nt&#34;&gt;&amp;#34;lldb.library&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;/usr/lib/liblldb.so&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nt&#34;&gt;&amp;#34;extensions&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;s2&#34;&gt;&amp;#34;sswg.swift-lang&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;s2&#34;&gt;&amp;#34;streetsidesoftware.code-spell-checker&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;#34;remoteUser&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;root&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;#34;postCreateCommand&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;apt-get update &amp;amp;&amp;amp; apt-get install -y libssl-dev libsqlite3-dev zlib1g-dev make &amp;amp;&amp;amp; rm -rf toolbox &amp;amp;&amp;amp; git clone https://github.com/vapor/toolbox.git &amp;amp;&amp;amp; cd toolbox &amp;amp;&amp;amp; make install &amp;amp;&amp;amp; cd .. &amp;amp;&amp;amp; rm -rf toolbox&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id=&#34;scala&#34;&gt;&lt;a href=&#34;#scala&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Scala&#xA;&lt;/h1&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Scala&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;image&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;mcr.microsoft.com/devcontainers/java:1-21-bullseye&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;features&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;ghcr.io/devcontainers/features/java:1&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;none&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;installMaven&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;false&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;installGradle&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;false&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;postCreateCommand&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;curl -fL https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-pc-linux.gz | gzip -d &amp;gt; cs &amp;amp;&amp;amp; chmod +x cs &amp;amp;&amp;amp; yes | ./cs setup &amp;amp;&amp;amp; echo &amp;#39;before start run source ~/.profile&amp;#39;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;customizations&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;vscode&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;extensions&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&#x9;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scala-lang.scala&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&#x9;&lt;span class=&#34;s2&#34;&gt;&amp;#34;streetsidesoftware.code-spell-checker&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
        </item><item>
            <title>Fully Reload Websites in Safari</title>
            <link>/p/fully-reload-websites-in-safari/</link>
            <pubDate>Fri, 22 Dec 2023 01:40:53 +0000</pubDate>
            <guid>/p/fully-reload-websites-in-safari/</guid>
            <description>&lt;p&gt;One common challenge encountered during frontend development is the persistence of cached data in web browsers.&lt;/p&gt;&#xA;&lt;p&gt;While browser caches efficiently save time by storing assets and eliminating the need to download them on every website visit, they can pose problems during development when changes are made to the code.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-force-a-full-reload-in-safari-with-all-assets&#34;&gt;&lt;a href=&#34;#how-to-force-a-full-reload-in-safari-with-all-assets&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;How to Force a Full Reload in Safari with All Assets&#xA;&lt;/h2&gt;&lt;p&gt;In Safari, resolving this issue is a straightforward process.&lt;/p&gt;&#xA;&lt;p&gt;Ensure that &lt;strong&gt;Developer Tools&lt;/strong&gt; are enabled by pressing &lt;code&gt;CMD + ,&lt;/code&gt;. Next, navigate to the &lt;strong&gt;Advanced&lt;/strong&gt; tab, and at the bottom of the window, select &lt;strong&gt;Show features for web developers&lt;/strong&gt;. Now you can close this settings window.&lt;/p&gt;&#xA;&lt;p&gt;To &lt;strong&gt;perform a full reload&lt;/strong&gt;, simply press &lt;code&gt;CMD + OPT + R&lt;/code&gt; (Safari 11+). This action reloads the current page, bypassing any cached data present in Safari.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;&lt;a href=&#34;#conclusion&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Conclusion&#xA;&lt;/h2&gt;&lt;p&gt;By incorporating this simple tip into our workflow, we can enhance efficiency in frontend development, particularly when dealing with assets.&lt;/p&gt;&#xA;&lt;p&gt;It can be frustrating not to see updated images, leading us to question our code. However, in many cases, it&amp;rsquo;s just the cache doing its job.&lt;/p&gt;&#xA;&lt;p&gt;I trust this brief post proves helpful in resolving such issues.&lt;/p&gt;&#xA;&lt;p&gt;Until next time!&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>Deleting Duplicates Subdirectories and Content</title>
            <link>/p/deleting-duplicates-subdirectories-and-content/</link>
            <pubDate>Fri, 22 Dec 2023 01:13:31 +0000</pubDate>
            <guid>/p/deleting-duplicates-subdirectories-and-content/</guid>
            <description>&lt;p&gt;The other day, I encountered an issue involving three directories, and two of them contained a subdirectory with the same name (target).&lt;/p&gt;&#xA;&lt;p&gt;My goal is to delete the target subdirectories in all places with a single command, and here&amp;rsquo;s the solution I found.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;    &lt;img src=&#34;/posts/delete-duplicates-subdirectories/directory-tree.png&#34;&#xA;        loading=&#34;lazy&#34;&#xA;        &#xA;            alt=&#34;directory tree&#34;&#xA;        &#xA;    &gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-the-terminal-to-delete-multiple-directories&#34;&gt;&lt;a href=&#34;#using-the-terminal-to-delete-multiple-directories&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Using the terminal to delete multiple directories.&#xA;&lt;/h2&gt;&lt;p&gt;There is an useful command called &lt;code&gt;find&lt;/code&gt;, this command is used to traverse nested directories and evaluate an expression for each element.&lt;/p&gt;&#xA;&lt;p&gt;We can use &lt;code&gt;find&lt;/code&gt; to delete files or directories, here is the command:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;find . -type d -name &lt;span class=&#34;s2&#34;&gt;&amp;#34;target&amp;#34;&lt;/span&gt; -exec rm -rf &lt;span class=&#34;o&#34;&gt;{}&lt;/span&gt; +&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;understanding-the-command&#34;&gt;&lt;a href=&#34;#understanding-the-command&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Understanding the command&#xA;&lt;/h2&gt;&lt;p&gt;This command is easy to grasp, first we have &lt;code&gt;.&lt;/code&gt;, this is telling &lt;code&gt;find&lt;/code&gt; to start traversing in the current directory.&lt;/p&gt;&#xA;&lt;p&gt;Next we have &lt;code&gt;-type&lt;/code&gt;, this argument allows to select a a specific valid type.&lt;/p&gt;&#xA;&lt;p&gt;The valid types are listed below:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;b&lt;/strong&gt;: block special&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;c&lt;/strong&gt;: character special&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;d&lt;/strong&gt;: directory&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;f&lt;/strong&gt;: regular file&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;l&lt;/strong&gt;: symbolic link&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;p&lt;/strong&gt;: FIFO&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;s&lt;/strong&gt;: socket&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Since we need to find an specific directory we use &lt;code&gt;d&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Next it&amp;rsquo;s &lt;code&gt;-name&lt;/code&gt;, we need to give the string that contains the name we are searching for. In our case we are looking for the directories named &lt;code&gt;&amp;quot;target&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The last part of the command, &lt;code&gt;-exec&lt;/code&gt;, is telling what to do once we find a valid element. In this case we want to delete all the found occurrences, so we&amp;rsquo;re passing &lt;code&gt;rm -rf&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;{}&lt;/code&gt; is just telling that we need to use the current element&amp;rsquo;s name, and &lt;code&gt;+&lt;/code&gt; is used to terminate the &lt;code&gt;-exec&lt;/code&gt; part.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;&lt;a href=&#34;#conclusion&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Conclusion&#xA;&lt;/h2&gt;&lt;p&gt;By using this simple command we can find and delete subdirectories in an easy and convenient way, which I find to be faster than using the GUI.&lt;/p&gt;&#xA;&lt;p&gt;I hope this simple tutorial can help you to solve these kind of problems.&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>Comparing Files in Vscode</title>
            <link>/p/comparing-files-in-vscode/</link>
            <pubDate>Tue, 07 Nov 2023 16:58:58 -0600</pubDate>
            <guid>/p/comparing-files-in-vscode/</guid>
            <description>&lt;p&gt;Today, I&amp;rsquo;d like to share a simple trick for comparing the states of files using both the terminal and VSCode.&lt;/p&gt;&#xA;&lt;h2 id=&#34;comparing-files&#34;&gt;&lt;a href=&#34;#comparing-files&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Comparing files&#xA;&lt;/h2&gt;&lt;p&gt;Typically, when we need to check for differences between two files, we can use &lt;code&gt;git diff&lt;/code&gt; if the files are within a Git repository or simply &lt;code&gt;diff&lt;/code&gt; if the files are local.&lt;/p&gt;&#xA;&lt;p&gt;However, these commands lack a user-friendly interface for comparing files, which is where VSCode&amp;rsquo;s file comparison feature comes in handy.&lt;/p&gt;&#xA;&lt;h2 id=&#34;steps-&#34;&gt;&lt;a href=&#34;#steps-&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Steps 👍&#xA;&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;First, we need to obtain the file paths of the files we want to compare.&lt;/li&gt;&#xA;&lt;li&gt;Open your terminal and run the following command: &lt;code&gt;code --diff /path/fileA /path/fileB&lt;/code&gt;, then press Enter.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;    &lt;img src=&#34;/posts/comparing-files-vscode/terminal-diff.png&#34;&#xA;        loading=&#34;lazy&#34;&#xA;        &#xA;            alt=&#34;Terminal Comparing&#34;&#xA;        &#xA;    &gt;&lt;/p&gt;&#xA;&lt;p&gt;&#xA;    &lt;img src=&#34;/posts/comparing-files-vscode/vscode-diff-window.png&#34;&#xA;        loading=&#34;lazy&#34;&#xA;        &#xA;            alt=&#34;VSCode Comparing&#34;&#xA;        &#xA;    &gt;&lt;/p&gt;&#xA;&lt;p&gt;VSCode will open, displaying the differences between both files in a clear and user-friendly manner.&lt;/p&gt;&#xA;&lt;p&gt;Additionally, any changes you make to the files during this comparison can be conveniently saved back to the original files.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;&lt;a href=&#34;#conclusion&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Conclusion&#xA;&lt;/h2&gt;&lt;p&gt;For swift and efficient file comparison, VSCode provides a valuable graphical user interface (GUI). This nifty trick can save time and help prevent mistakes, as you can instantly see how your changes impact the differences between the files.&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>Working With Git Submodules</title>
            <link>/p/working-with-git-submodules/</link>
            <pubDate>Wed, 25 Oct 2023 00:03:41 -0600</pubDate>
            <guid>/p/working-with-git-submodules/</guid>
            <description>&lt;p&gt;The other day, I was working on a project that had a Git submodule. Initially, I found it a bit tricky to make it work, so I decided to create a short tutorial on this.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-a-git-submodule&#34;&gt;&lt;a href=&#34;#what-is-a-git-submodule&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;What is a Git submodule&#xA;&lt;/h2&gt;&lt;p&gt;Essentially, a Git submodule is a way to include one Git repository inside another Git repository. This creates a nested structure.&lt;/p&gt;&#xA;&lt;p&gt;So, in simple words, a Git submodule is like a mini Git repository that you can include in your main Git repository to use and update external code or resources without actually putting all of their files directly in your project.&lt;/p&gt;&#xA;&lt;p&gt;The crucial point to note is that, by default, the code of the submodule is not added to your Git repository when performing the initial &lt;code&gt;git clone&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-check-the-ulr-of-the-git-submodule&#34;&gt;&lt;a href=&#34;#how-to-check-the-ulr-of-the-git-submodule&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;How to check the ulr of the git submodule&#xA;&lt;/h2&gt;&lt;p&gt;To check the linked URLs of submodules we can use this command.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git config --file .gitmodules --get-regexp &lt;span class=&#34;s1&#34;&gt;&amp;#39;submodule\..*\.url&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;how-to-clone-a-submodule&#34;&gt;&lt;a href=&#34;#how-to-clone-a-submodule&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;How to clone a submodule&#xA;&lt;/h2&gt;&lt;p&gt;There could be three situations:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You want to clone the git project with all its submodules for the first time.&lt;/li&gt;&#xA;&lt;li&gt;You&amp;rsquo;ve cloned the git project but didn&amp;rsquo;t fetch the submodules.&lt;/li&gt;&#xA;&lt;li&gt;You want to update the submodules in your project.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;cloning-a-project-with-all-submodules-for-the-first-time&#34;&gt;&lt;a href=&#34;#cloning-a-project-with-all-submodules-for-the-first-time&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Cloning a project with all submodules for the first time&#xA;&lt;/h3&gt;&lt;p&gt;If you want to clone a project for the first time with all its submodules, you can run the following command.&lt;/p&gt;&#xA;&lt;p&gt;With Git version 2.13 or newer.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone --recurse-submodules -j8 https://github.com/your/repo.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;-j8&lt;/code&gt; is an optional performance optimization that became available in version 2.8, and fetches up to 8 submodules at a time in parallel&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Before Git 2.12.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone --recursive https://github.com/your/repo.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;cloning-the-submodules-only&#34;&gt;&lt;a href=&#34;#cloning-the-submodules-only&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Cloning the submodules only&#xA;&lt;/h3&gt;&lt;p&gt;If you&amp;rsquo;ve downloaded the project but forgot to fetch the submodules, you can use this command.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git submodule update --init --recursive&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;&#xA;&lt;p&gt;If you&amp;rsquo;ve cloned only the main Git repository, you&amp;rsquo;ll be missing the submodule files, potentially causing your project to fail.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h3 id=&#34;updating-the-submodules&#34;&gt;&lt;a href=&#34;#updating-the-submodules&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Updating the submodules&#xA;&lt;/h3&gt;&lt;p&gt;If you want to update the code of the submodules, you need to run this command.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git submodule update --recursive --remote&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;&#xA;&lt;p&gt;This will only update the branch registered in the &lt;code&gt;.gitmodule&lt;/code&gt;, and by default, you will end up with a detached HEAD, unless &amp;ndash;rebase or &amp;ndash;merge is specified or the key submodule.$name.update is set to rebase, merge or none.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h2 id=&#34;adding-a-submodule-to-a-git-repository&#34;&gt;&lt;a href=&#34;#adding-a-submodule-to-a-git-repository&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Adding a submodule to a git repository&#xA;&lt;/h2&gt;&lt;p&gt;To add another remote Git repository as a submodule to your current Git repository, you can use this command.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git submodule add https://github.com/your/repo.git path/to_save/in_repo&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The provided code allows you to specify the remote URL for the repository you want to use as a submodule, as well as the path within your project where you want to save the cloned code.&lt;/p&gt;&#xA;&lt;h2 id=&#34;delete-a-git-submodule-from-your-project&#34;&gt;&lt;a href=&#34;#delete-a-git-submodule-from-your-project&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Delete a Git submodule from your project&#xA;&lt;/h2&gt;&lt;p&gt;This process is common but not that straightforward, here are the steps you need to do.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The files mentioned in the following steps are located in the root directory of your project, which is the default location for the Git files.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Delete the relevant line from the &lt;code&gt;.gitmodules&lt;/code&gt; file.&lt;/li&gt;&#xA;&lt;li&gt;Delete the relevant section from &lt;code&gt;.git/config&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;git rm --cached path_to_submodule&lt;/code&gt; (no trailing slash).&lt;/li&gt;&#xA;&lt;li&gt;Commit and delete the now untracked submodule files.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A trailing slash is the slash that can be added to the end of the path. &lt;code&gt;submodules/my_submodule/&lt;/code&gt; has a trailing slash while &lt;code&gt;submodules/my_submodule&lt;/code&gt; doesn&amp;rsquo;t have one.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;&lt;a href=&#34;#conclusion&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Conclusion&#xA;&lt;/h2&gt;&lt;p&gt;Git submodules are a powerful feature for managing dependencies in your projects. They allow you to include external Git repositories within your main repository without cluttering it with their files. This can be especially handy when you&amp;rsquo;re working on projects that rely on external code or resources.&lt;/p&gt;&#xA;&lt;p&gt;We&amp;rsquo;ve covered some essential aspects of working with Git submodules in this tutorial. You&amp;rsquo;ve learned what a Git submodule is and how to check the URLs of linked submodules. You also know how to clone a project with all its submodules, how to retrieve submodules if you&amp;rsquo;ve forgotten them, and how to keep them updated. Furthermore, we discussed adding and deleting a submodule from your Git repository.&lt;/p&gt;&#xA;&lt;p&gt;With this knowledge, you&amp;rsquo;ll be better equipped to manage complex projects with Git submodules and streamline your workflow. So, don&amp;rsquo;t shy away from using them in your projects when they can help you manage external code more efficiently.&lt;/p&gt;&#xA;&lt;p&gt;Happy coding 🚀!&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
