"simple" vs "current" push.default in git for decentralized workflow

57,336

The difference is that simple pushes to its tracking branch if it has the same name, while current will push to a branch of the same name regardless of any tracking branch:

$ git branch -vvv
  master 58d9fdc [origin/master: ahead 1] t1 bobo
* new    37132d3 [origin/save: ahead 1] t1 bibi   # <- tracking branch 'save'

$ git -c push.default=current push                # <- set `push.default=current`
Counting objects: 3, done.
Writing objects: 100% (3/3), 234 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /home/jthill/sandbox/20/t1
 * [new branch]      new -> new                   # <- and push creates `new` 
Share:
57,336
void.pointer
Author by

void.pointer

Updated on January 22, 2021

Comments

  • void.pointer
    void.pointer over 3 years

    Functionally speaking, in a decentralized workflow, I don't see the difference between simple and current options for push.default config setting.

    current will push the current branch to an identically named branch on the specified remote. simple will effectively do the same thing as well for both the tracked and any untracked remotes for the current branch (it enforces identical branch names in both cases).

    Can someone explain any important differences between the two for decentralized workflows that I am missing?