{
    "archive_path": "archive/1788127631.972285",
    "base_url": "ryangreenberg.com/til/git-branches-by-commit-date",
    "basename": "",
    "bookmarked_date": "2026-08-30 22:07",
    "canonical": {
        "archive_org_path": "https://web.archive.org/web/ryangreenberg.com/til/git-branches-by-commit-date",
        "dom_path": "output.html",
        "favicon_path": "favicon.ico",
        "git_path": "git/",
        "google_favicon_path": "https://www.google.com/s2/favicons?domain=ryangreenberg.com",
        "headers_path": "headers.json",
        "htmltotext_path": "htmltotext.txt",
        "index_path": "index.html",
        "media_path": "media/",
        "mercury_path": "mercury/content.html",
        "pdf_path": "output.pdf",
        "readability_path": "readability/content.html",
        "screenshot_path": "screenshot.png",
        "singlefile_path": "singlefile.html",
        "warc_path": "warc/",
        "wget_path": "ryangreenberg.com/til/git-branches-by-commit-date/index.html"
    },
    "domain": "ryangreenberg.com",
    "extension": "",
    "hash": "15B9T5G3KRQC7F6A8RMX",
    "history": {
        "archive_org": [],
        "dom": [],
        "favicon": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--output",
                    "favicon.ico",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://www.google.com/s2/favicons?domain=ryangreenberg.com"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-08-30T22:08:42.007626+00:00",
                "index_texts": null,
                "output": "favicon.ico",
                "pwd": "/data/archive/1788127631.972285",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-30T22:08:41.523417+00:00",
                "status": "succeeded"
            }
        ],
        "git": [],
        "headers": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--head",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://ryangreenberg.com/til/git-branches-by-commit-date/"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-08-30T22:08:42.351507+00:00",
                "index_texts": null,
                "output": "headers.json",
                "pwd": "/data/archive/1788127631.972285",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-30T22:08:42.021740+00:00",
                "status": "succeeded"
            }
        ],
        "htmltotext": [],
        "media": [],
        "mercury": [
            {
                "cmd": [
                    "/app/node_modules/@postlight/parser/cli.js",
                    "https://ryangreenberg.com/til/git-branches-by-commit-date/"
                ],
                "cmd_version": "1.0.0",
                "end_ts": "2026-08-30T22:08:48.595619+00:00",
                "index_texts": null,
                "output": "mercury",
                "pwd": "/data/archive/1788127631.972285",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-30T22:08:45.876507+00:00",
                "status": "succeeded"
            }
        ],
        "pdf": [],
        "readability": [
            {
                "cmd": [
                    "/app/node_modules/readability-extractor/readability-extractor",
                    "/tmp/tmpdbx_c62d",
                    "https://ryangreenberg.com/til/git-branches-by-commit-date/"
                ],
                "cmd_version": "0.0.11",
                "end_ts": "2026-08-30T22:08:45.866921+00:00",
                "index_texts": [
                    "I have too many git branches and like many people I developed a convoluted script to show me the most recent ones. I ran this command many times a day for years:\nfunction branches {\n  for k in `git branch | sed \"s/^..//\"`; do\n    echo -e `git log --color -1 --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset\" \"$k\"`\\\\t\"$k\";\n  done | sort\n}\nThis outputs the date as the first column in the output so that sort works. Turns out with modern git it\u2019s totally unnecessary. Just configure git branch to sort by the last commit date:\ngit config branch.sort committerdate\nYou can also supply this on a one-off basis as git branch --sort committerdate.\nWhat else can you sort by? The manual says \u201cThe keys supported are the same as those in git-for-each-ref(1).\u201d The manpage for git-for-each-ref lists a ton of fields, including some that don\u2019t make sense to me as sort keys. Here are a few that stood out as interesting:\n\nauthordate, committerdate, creatordate, taggerdate\ncontents:size: The size in bytes of the commit or tag message.\npush: The name of a local ref which represents the @{push} location for the displayed ref.\nrefname: The name of the ref (the part after $GIT_DIR/) (this is the default).\nupstream: The name of a local ref which can be considered \u201cupstream\u201d from the displayed ref."
                ],
                "output": "readability",
                "pwd": "/data/archive/1788127631.972285",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-30T22:08:44.393859+00:00",
                "status": "succeeded"
            }
        ],
        "screenshot": [],
        "singlefile": [],
        "title": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://ryangreenberg.com/til/git-branches-by-commit-date/"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-08-30T22:08:44.386048+00:00",
                "index_texts": null,
                "output": "Sort branches by last commit date",
                "pwd": "/data/archive/1788127631.972285",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-30T22:08:44.376332+00:00",
                "status": "succeeded"
            }
        ],
        "wget": [
            {
                "cmd": [
                    "wget",
                    "--no-verbose",
                    "--adjust-extension",
                    "--convert-links",
                    "--force-directories",
                    "--backup-converted",
                    "--span-hosts",
                    "--no-parent",
                    "-e",
                    "robots=off",
                    "--timeout=120",
                    "--restrict-file-names=windows",
                    "--warc-file=/data/archive/1788127631.972285/warc/1788127722",
                    "--page-requisites",
                    "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) wget/GNU Wget 1.21.3",
                    "--compression=auto",
                    "https://ryangreenberg.com/til/git-branches-by-commit-date/"
                ],
                "cmd_version": "GNU Wget 1.21.3",
                "end_ts": "2026-08-30T22:08:44.363435+00:00",
                "index_texts": null,
                "output": "ryangreenberg.com/til/git-branches-by-commit-date/index.html",
                "pwd": "/data/archive/1788127631.972285",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-30T22:08:42.361276+00:00",
                "status": "succeeded"
            }
        ]
    },
    "icons": null,
    "is_archived": true,
    "is_static": false,
    "latest": {
        "archive_org": null,
        "dom": null,
        "favicon": "favicon.ico",
        "git": null,
        "media": null,
        "pdf": null,
        "screenshot": null,
        "singlefile": null,
        "title": "Sort branches by last commit date",
        "warc": null,
        "wget": "ryangreenberg.com/til/git-branches-by-commit-date/index.html"
    },
    "link_dir": "/data/archive/1788127631.972285",
    "newest_archive_date": "2026-08-30T22:08:45.876507+00:00",
    "num_failures": 0,
    "num_outputs": 6,
    "oldest_archive_date": "2026-08-30T22:08:41.523417+00:00",
    "path": "/til/git-branches-by-commit-date/",
    "schema": "Link",
    "scheme": "https",
    "snapshot_id": "1903f75a-9220-4d73-afd0-fb19451a9ee6",
    "sources": [
        "/data/sources/1788127631-import.txt"
    ],
    "tags": null,
    "tags_str": "",
    "timestamp": "1788127631.972285",
    "title": "Sort branches by last commit date",
    "updated": "2026-08-30T22:08:41.522877+00:00",
    "updated_date": "2026-08-30 22:08",
    "url": "https://ryangreenberg.com/til/git-branches-by-commit-date/"
}