From: Harald Nordgren via GitGitGadget Date: Thu, 18 Jun 2026 12:44:10 GMT Subject: [PATCH v14 0/2] checkout: --track=fetch Message-ID: In-Reply-To: Extend checkout --track with a fetch mode to refresh start-point. Changes in v14: * Handle .h files in a better way. Changes in v13: * Create a preparatory commit that exposes find_tracking_remote_for_ref() and advise_ambiguous_fetch_refspec() from branch.c, so checkout can reuse the same lookup git branch --track uses. * Use advise_ambiguous_fetch_refspec() for the "multiple remotes match" case, so the wording matches git branch --track. Harald Nordgren (2): branch: expose helpers for finding the remote owning a tracking ref checkout: extend --track with a "fetch" mode to refresh start-point Documentation/git-checkout.adoc | 17 +- Documentation/git-switch.adoc | 5 +- branch.c | 96 ++++++----- branch.h | 16 ++ builtin/checkout.c | 139 +++++++++++++++- t/t7201-co.sh | 276 ++++++++++++++++++++++++++++++++ 6 files changed, 498 insertions(+), 51 deletions(-) base-commit: 4621f8ce5e9b97aa2e8d0d9ffe9d25df2471074d Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2281%2FHaraldNordgren%2Fcheckout-fetch-start-point-v14 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2281/HaraldNordgren/checkout-fetch-start-point-v14 Pull-Request: https://github.com/git/git/pull/2281 Range-diff vs v13: 1: 2369afad24 ! 1: f79689c23d branch: expose helpers for finding the remote owning a tracking ref @@ branch.h #define BRANCH_H +#include "refspec.h" -+#include "string-list.h" + ++struct string_list; struct repository; struct strbuf; 2: 60adf0e67d ! 2: 8518f090b1 checkout: extend --track with a "fetch" mode to refresh start-point @@ builtin/checkout.c +#include "run-command.h" #include "sequencer.h" #include "setup.h" - #include "strvec.h" + #include "sparse-index.h" @@ builtin/checkout.c: struct checkout_opts { int count_checkout_paths; int overlay_mode; -- gitgitgadget