)]}'
{
  "commit": "8d7b558baebe3abbbad4973ce1e1f87a7da17f47",
  "tree": "2ef11545322a2d1de527588e2d5a2a41e2e47ddd",
  "parents": [
    "ad8d5104b42108851b082d895018655ad5f9e4f3"
  ],
  "author": {
    "name": "Ævar Arnfjörð Bjarmason",
    "email": "avarab@gmail.com",
    "time": "Tue Jun 05 14:40:49 2018 +0000"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Mon Jun 11 09:41:02 2018 -0700"
  },
  "message": "checkout \u0026 worktree: introduce checkout.defaultRemote\n\nIntroduce a checkout.defaultRemote setting which can be used to\ndesignate a remote to prefer (via checkout.defaultRemote\u003dorigin) when\nrunning e.g. \"git checkout master\" to mean origin/master, even though\nthere\u0027s other remotes that have the \"master\" branch.\n\nI want this because it\u0027s very handy to use this workflow to checkout a\nrepository and create a topic branch, then get back to a \"master\" as\nretrieved from upstream:\n\n    (\n        cd /tmp \u0026\u0026\n        rm -rf tbdiff \u0026\u0026\n        git clone git@github.com:trast/tbdiff.git \u0026\u0026\n        cd tbdiff \u0026\u0026\n        git branch -m topic \u0026\u0026\n        git checkout master\n    )\n\nThat will output:\n\n    Branch \u0027master\u0027 set up to track remote branch \u0027master\u0027 from \u0027origin\u0027.\n    Switched to a new branch \u0027master\u0027\n\nBut as soon as a new remote is added (e.g. just to inspect something\nfrom someone else) the DWIMery goes away:\n\n    (\n        cd /tmp \u0026\u0026\n        rm -rf tbdiff \u0026\u0026\n        git clone git@github.com:trast/tbdiff.git \u0026\u0026\n        cd tbdiff \u0026\u0026\n        git branch -m topic \u0026\u0026\n        git remote add avar git@github.com:avar/tbdiff.git \u0026\u0026\n        git fetch avar \u0026\u0026\n        git checkout master\n    )\n\nWill output (without the advice output added earlier in this series):\n\n    error: pathspec \u0027master\u0027 did not match any file(s) known to git.\n\nThe new checkout.defaultRemote config allows me to say that whenever\nthat ambiguity comes up I\u0027d like to prefer \"origin\", and it\u0027ll still\nwork as though the only remote I had was \"origin\".\n\nAlso adjust the advice.checkoutAmbiguousRemoteBranchName message to\nmention this new config setting to the user, the full output on my\ngit.git is now (the last paragraph is new):\n\n    $ ./git --exec-path\u003d$PWD checkout master\n    error: pathspec \u0027master\u0027 did not match any file(s) known to git.\n    hint: \u0027master\u0027 matched more than one remote tracking branch.\n    hint: We found 26 remotes with a reference that matched. So we fell back\n    hint: on trying to resolve the argument as a path, but failed there too!\n    hint:\n    hint: If you meant to check out a remote tracking branch on, e.g. \u0027origin\u0027,\n    hint: you can do so by fully qualifying the name with the --track option:\n    hint:\n    hint:     git checkout --track origin/\u003cname\u003e\n    hint:\n    hint: If you\u0027d like to always have checkouts of an ambiguous \u003cname\u003e prefer\n    hint: one remote, e.g. the \u0027origin\u0027 remote, consider setting\n    hint: checkout.defaultRemote\u003dorigin in your config.\n\nI considered splitting this into checkout.defaultRemote and\nworktree.defaultRemote, but it\u0027s probably less confusing to break our\nown rules that anything shared between config should live in core.*\nthan have two config settings, and I couldn\u0027t come up with a short\nname under core.* that made sense (core.defaultRemoteForCheckout?).\n\nSee also 70c9ac2f19 (\"DWIM \"git checkout frotz\" to \"git checkout -b\nfrotz origin/frotz\"\", 2009-10-18) which introduced this DWIM feature\nto begin with, and 4e85333197 (\"worktree: make add \u003cpath\u003e \u003cbranch\u003e\ndwim\", 2017-11-26) which added it to git-worktree.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason \u003cavarab@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "dfc0413a842692370aa26d151d36d6cd94a90a07",
      "old_mode": 33188,
      "old_path": "Documentation/config.txt",
      "new_id": "aef2769211acf4c7d5776d7ed44327efa8e471c5",
      "new_mode": 33188,
      "new_path": "Documentation/config.txt"
    },
    {
      "type": "modify",
      "old_id": "ca5fc9c79887652e38e3d11dc86dba657fe585c0",
      "old_mode": 33188,
      "old_path": "Documentation/git-checkout.txt",
      "new_id": "9db02928c4634ea07c3950b1431bdf9981ec1ab9",
      "new_mode": 33188,
      "new_path": "Documentation/git-checkout.txt"
    },
    {
      "type": "modify",
      "old_id": "afc6576a14d56ea49e37d1251a5665bf77457f89",
      "old_mode": 33188,
      "old_path": "Documentation/git-worktree.txt",
      "new_id": "9c26be40f4412b5f0a9c478236b9d3c38fcb14ec",
      "new_mode": 33188,
      "new_path": "Documentation/git-worktree.txt"
    },
    {
      "type": "modify",
      "old_id": "baa027455ad74df72700b90893291ae4dc545254",
      "old_mode": 33188,
      "old_path": "builtin/checkout.c",
      "new_id": "5b357e922a59cf5058c20d07d2ced73a4ad555e4",
      "new_mode": 33188,
      "new_path": "builtin/checkout.c"
    },
    {
      "type": "modify",
      "old_id": "ee3a7e9c052ab5936d99e739fd18b0ede4799454",
      "old_mode": 33188,
      "old_path": "checkout.c",
      "new_id": "c72e9f9773e173c0dbcb5de88bde54d5434cf808",
      "new_mode": 33188,
      "new_path": "checkout.c"
    },
    {
      "type": "modify",
      "old_id": "082147a875c2999210fd1870b12167c6f6fda909",
      "old_mode": 33261,
      "old_path": "t/t2024-checkout-dwim.sh",
      "new_id": "26dc3f1fc0c25df1b359b5d56aece9f171344f5a",
      "new_mode": 33261,
      "new_path": "t/t2024-checkout-dwim.sh"
    },
    {
      "type": "modify",
      "old_id": "d2e49f763263333e8e269051686d3b8b2cae44ba",
      "old_mode": 33261,
      "old_path": "t/t2025-worktree-add.sh",
      "new_id": "be6e093142cdbeb18fa0ff155f3adf1e7a566ca2",
      "new_mode": 33261,
      "new_path": "t/t2025-worktree-add.sh"
    }
  ]
}
