FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Pull: actually fetch all remote branches, not just current by jamiew · Pull Request #133 · git-friendly/git-friendly · GitHub

Pull: actually fetch all remote branches, not just current - #133

Merged
jamiew merged 1 commit into
mainfrom
pull-fetch-all-branches
May 12, 2026
Merged

Pull: actually fetch all remote branches, not just current#133
jamiew merged 1 commit into
mainfrom
pull-fetch-all-branches

Conversation

jamiew commented May 12, 2026

Copy link
Copy Markdown
Collaborator

turns out pull was only updating the current branch's remote ref — git pull <remote> <branch> with an explicit refspec skips the remote's normal fetch = +refs/heads/* config, so other origin/* refs went stale until you separately ran git fetch. that's why new origin branches sometimes weren't there after a pull.

  • run an explicit git fetch --prune before the rebase-pull so all remote-tracking branches refresh
  • drop the backgrounded git remote prune — --prune on the fetch handles it synchronously
  • scoped to $remote (not --all) to preserve behavior for repos with multiple remotes

to test:

  • in a repo where origin has a brand-new branch you don't have locally, run ./pull and confirm git branch -r now shows it
  • delete a branch on origin, run ./pull, confirm the stale origin/* ref is gone

- `git pull <remote> <branch>` only updates the named ref, leaving other origin/* refs stale until you separately `git fetch`
- run an explicit `git fetch --prune` first so remote-tracking branches stay complete
- drop the backgrounded `git remote prune` since `--prune` on the fetch covers it synchronously
jamiew merged commit 8be8602 into main May 12, 2026
1 check passed
jamiew deleted the pull-fetch-all-branches branch May 12, 2026 21:52
jamiew added a commit that referenced this pull request May 29, 2026
- the explicit `git fetch` added in #133 recursed into submodules, and so does the `git pull --recurse-submodules` right after, so every submodule got fetched twice
- pass `--no-recurse-submodules` to the branch-refresh fetch; the recursive pull still owns submodule updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL