git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/2] branch: -d protects upstream branches

From
Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 25, 2026, 21:25 UTC
Message-ID
<pull.2365.git.git.1787693117.gitgitgadget@gmail.com>

Protect local branches from git branch -d when a surviving branch depends on them through a local upstream chain.

Harald Nordgren (2):
  branch: move stacked branch helpers
  branch: protect local upstreams from -d
 Documentation/git-branch.adoc |   4 +-
 builtin/branch.c              | 142 +++++++++++++++++++++-------------
 t/t1507-rev-parse-upstream.sh |   4 +-
 t/t3200-branch.sh             |  43 ++++++++++
 t/t6040-tracking-info.sh      |   2 +-
 5 files changed, 137 insertions(+), 58 deletions(-)
base-commit: 2c3adbb2c475981e340c79fdc5e7f4f9b5d9054e
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2365%2FHaraldNordgren%2Fbranch-d-protect-stacked-upstreams-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2365/HaraldNordgren/branch-d-protect-stacked-upstreams-v1
Pull-Request: https://github.com/git/git/pull/2365
-- 
gitgitgadget
Next: Harald Nordgren via GitGitGadget
Message 1 of 9 in “branch: -d protects upstream branches”
  1. 0/2 branch: -d protects upstream branchesHarald Nordgren via GitGitGadget, Aug 25, 2026
  2. 1/2 branch: move stacked branch helpersHarald Nordgren via GitGitGadget, Aug 25, 2026
  3. 2/2 branch: protect local upstreams from -dHarald Nordgren via GitGitGadget, Aug 25, 2026
  4. Junio C HamanoAug 25, 2026
  5. Harald NordgrenAug 26, 2026
  6. Tuomas AholaAug 26, 2026
  7. Harald NordgrenAug 26, 2026
  8. Junio C HamanoAug 26, 2026
  9. Elijah NewrenAug 27, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.