-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
None
-
Affects Version/s: 3.4.24
-
Component/s: General
-
None
-
Minor
When working with multiple remotes and local branches tracking branches with the same name on different remotes, SourceTree does not correctly use the configured upstream tracking information for Push/Pull operations.
Instead of using the remote and branch configured in the branch tracking configuration, SourceTree appears to infer the remote based on the local branch name, causing Push/Pull operations to target the wrong remote branch.
Reproduction steps
- Create a repository with two remotes pointing to different forks of the same project:
-
- origin
-
- next
- Both remotes contain the same branch:
-
- develop
- Create two local branches:
-
- develop tracking origin/develop
-
- develop-next tracking next/develop
- Verify the upstream configuration:
git branch -vv
Expected result:
{{develop -> origin/develop
develop-next -> next/develop}}
- Perform Pull or Push operations from SourceTree.
Expected behavior
SourceTree should always use the remote and branch configured in the upstream tracking information.
For example:
- Pulling from develop should execute against origin/develop
- Pulling from develop-next should execute against next/develop
The local branch name should not influence the remote selection.
Actual behavior
SourceTree appears to determine the remote based on the branch naming convention rather than the configured tracking branch.
As a result, Push/Pull operations may target the wrong remote or fail because SourceTree tries to resolve the branch against an incorrect remote.
Additional context
This happens when using multiple remotes containing branches with identical names, which is a common scenario when working with forks.
The Git configuration itself is correct and standard Git commands correctly respect the upstream tracking configuration:
{{git pull
git push}}
The issue seems to be specific to SourceTree's handling of the configured tracking branch.