GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
build

gcc_update: Support Git worktrees with --no-fetch option

The `gcc_update` script now supports Git worktrees by allowing updates without a fetch, using `git rebase` instead.

The contrib/gcc_update script has been enhanced to support Git worktrees, a feature allowing multiple checkouts to share a single repository. A new --no-fetch option suppresses the git pull command and instead uses git rebase. This is beneficial for worktrees as it avoids redundant upstream syncs while still updating revision files, mirroring the behavior of a standard fetch.

In Details

The contrib/gcc_update script, used for updating the GCC source tree, now includes a --no-fetch option when the underlying version control system is Git. This option changes the update mechanism from git pull to git rebase, which is more efficient for Git worktrees that share a common repository. The script still performs post-update actions like updating LAST_UPDATED and gcc/REVISION files, ensuring consistency across worktrees.

For Context
Git worktree
A feature in Git that allows a developer to have multiple working directories associated with a single repository. Each worktree can check out a different branch or commit, facilitating parallel development or testing without the need to constantly switch branches in a single checkout.
git rebase
A Git command that allows developers to reapply commits from one branch onto another. It's often used to maintain a linear project history by moving a series of commits to a new base commit.
git pull
A Git command that fetches changes from a remote repository and merges them into the current branch. It's a common way to update a local repository with changes from a shared remote.
Filed Under: buildgitworkflow