Skip to content

Git: Fix branch.autoSetupMerge from 'always' to 'simple' #48

@chicham

Description

@chicham

Description

The git configuration branch.autoSetupMerge = always causes incorrect upstream tracking when creating branches from local branches.

Current Behavior

In dot_gitconfig.tmpl:71:

[branch]
    autoSetupMerge = always

When you create a new branch from a local branch:

git checkout -b feature-b feature-a

The upstream is set to the local branch feature-a instead of a remote branch.

Problem

This conflicts with push.autoSetupRemote = true workflow and causes confusion about where branches should push.

Proposed Fix

Change to:

[branch]
    autoSetupMerge = simple

With simple, upstream is only set when the start point is a remote-tracking branch (e.g., origin/main), which keeps the push.autoSetupRemote=true workflow intact.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions