From c5f20146dc4b55937130968752e14ba581087c48 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Mon, 7 Oct 2024 11:49:54 -0400 Subject: [PATCH] fix(bin): git-fetch-branch should work when filtering remote braches --- bin/git-fetch-branch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/git-fetch-branch b/bin/git-fetch-branch index 9e33d24..0935a71 100755 --- a/bin/git-fetch-branch +++ b/bin/git-fetch-branch @@ -23,4 +23,8 @@ case "$#" in *) usage ;; esac -exec git fetch "${remote}" "${branch}:${branch}" + +# I often change the fetch refmap to only watch my development branches and +# permanent shared ones. Explicitly use a default-ish refmap to undo that and +# make this create a named local branch. +exec git fetch --refmap='+refs/heads/*:refs/remotes/origin/*' "${remote}" "${branch}:${branch}"