Fix Create & Switch to Branch upstream tracking from remote refs#5397
Draft
sergeibbb wants to merge 1 commit into
Draft
Fix Create & Switch to Branch upstream tracking from remote refs#5397sergeibbb wants to merge 1 commit into
sergeibbb wants to merge 1 commit into
Conversation
Introduces a `noTracking` option to the `checkout` operation, allowing `git checkout -b --no-track` to be used. The `GitRepositoryService.switch` method now supports this option, which is leveraged by the `branch create --switch` command. When creating a local branch from a remote branch with a different name, the command will now use `--no-track` to prevent automatic setup of a remote tracking branch. (#5360, #5397)
48f2ee8 to
219a19a
Compare
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--no-tracktogit checkout -bwhen creating and switching to a branch from a remote ref with a different name, matching the existing behavior of "Create Branch" (without switch)--no-trackfix togit worktree add -b— creating a worktree from a remote ref with a different name also incorrectly set upstream trackingnoTrackingoption throughgitRepositoryService.switch()andcreateWorktree()down to their git implementationsGitOperationsSubProviderandGitWorktreesSubProviderinterfaces to includenoTracking--no-trackflag construction on checkoutFixes #5360
Test plan
noTrackingtest-no-track-5360fromorigin/master—git branch -vvshows no upstream trackinggit worktree add -b foo ... origin/mastersets upstream; confirmed--no-trackprevents it🤖 Generated with Claude Code