/oss · 6 merged

tj/git-extras

A set of extra Git commands for everyday chores, like squashing branches and summing up a repo.

the project on GitHub (opens in a new tab)
  1. 1 Dec 2026

    git sed leaves binary files alone

    What was broken
    git sed also replaced text inside binary files like jars and PDFs, breaking them, and could commit the broken files.
    What I changed
    It now edits only text files.
    Why it matters
    A search and replace across a repo no longer corrupts its binary files.

    see the code, #1297 (opens in a new tab)

  2. 1 Dec 2026

    delete-branch deletes the right remote branch

    What was broken
    For a branch started from main, git delete-branch deleted the remote main branch and left the branch you named.
    What I changed
    It now deletes the remote branch with the same name.
    Why it matters
    Cleaning up a branch can no longer wipe the main branch on the server.

    see the code, #1293 (opens in a new tab)

  3. 26 Nov 2026

    Merging a repo into the current folder keeps dotfiles

    What was broken
    Merging another repository into the current folder left out its hidden files, and could apply an old saved change by mistake.
    What I changed
    Hidden files are now included, and only the change saved during the merge is restored.
    Why it matters
    Merged repositories arrive complete, without surprise edits.

    see the code, #1291 (opens in a new tab)

  4. 25 Nov 2026

    effort and summary count files with non-ASCII names

    What was broken
    git effort skipped files with accented or other non-ASCII names, and git summary counted no lines for them.
    What I changed
    Both now read file names as they are instead of git's quoted form.
    Why it matters
    Projects with non-English file names get full stats.

    see the code, #1290 (opens in a new tab)

  5. 25 Nov 2026

    merge-into no longer applies an old stash

    What was broken
    With only untracked files present, merge-into stashed nothing and then popped an older, unrelated stash onto the branch.
    What I changed
    It now stashes only when there are tracked changes to save.
    Why it matters
    Saved work in the stash stays where it was.

    see the code, #1289 (opens in a new tab)

  6. 18 Nov 2026

    Squash leaves unfinished edits alone

    What was broken
    git squash also swept in any edited file you had not staged, putting half-done work into the commit.
    What I changed
    It now commits only what is staged.
    Why it matters
    Work in progress stays out of the squashed commit.

    see the code, #1285 (opens in a new tab)

← every project