$ ./guess_the_languageGit
Git · hard · #53

Which setting makes a plain git push create and track the remote branch automatically?

$ git switch -c feature
$ git push
fatal: The current branch feature has no upstream branch.
  1. branch.autoSetupMerge=true
  2. push.default=matching
  3. push.autoSetupRemote=true
  4. remote.pushDefault=origin
With push.autoSetupRemote (Git 2.37+), pushing a branch with no upstream behaves like git push -u origin <branch>.
Play Git ▸