{"thread":{"id":"52560","subject":"Re: git checkout -","startedAt":"2020-01-03T12:40:22Z","lastAt":"2020-01-04T05:19:06Z","messageCount":3,"participants":["Jonathan Nieder","Todd Zullinger","François WAUQUIER"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"390191","messageId":"CAFS-fjvhAB5EcfHhfp6HYN57W11tkHOc8K8T3oey8qceutuYsg@mail.gmail.com","threadId":"52560","inReplyTo":null,"subject":"","fromName":"François WAUQUIER","fromEmail":"wokier@gmail.com","sentAt":"2020-01-03T12:40:08Z","receivedAt":"2020-01-03T12:40:22Z","isPatch":false,"sender":{"key":"wokier@gmail.com","avatar":null},"body":"Hi\n\n$ git checkout -\n\nI often use this command to go back to previous branch from my history.\nIt is quite natural as it uses the same syntax as “cd -“\n\nBut i found out it is not documented in\nhttps://git-scm.com/docs/git-checkout/2.24.0\nI report this to help others to discover this time saving command.\n\nThanks for the great work with git\nHappy new year\n\n-- \nFrançois Wauquier\n"},{"id":"389205","messageId":"20200104004826.GC130883@google.com","threadId":"52560","inReplyTo":"CAFS-fjvhAB5EcfHhfp6HYN57W11tkHOc8K8T3oey8qceutuYsg@mail.gmail.com","subject":"Re: git checkout -","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2020-01-04T00:48:26Z","receivedAt":"2020-01-04T00:48:30Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nFrançois WAUQUIER wrote:\n\n> $ git checkout -\n>\n> I often use this command to go back to previous branch from my history.\n> It is quite natural as it uses the same syntax as “cd -“\n>\n> But i found out it is not documented in\n> https://git-scm.com/docs/git-checkout/2.24.0\n> I report this to help others to discover this time saving command.\n\nThanks for reporting!\n\nIdeas for what the documentation should say about it?  (Bonus points\nif it comes in the form of a patch against Documentation/git-checkout.txt.\n;-)  See [1] for more about how that works.)\n\nSincerely,\nJonathan\n\n[1] https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html\n"},{"id":"389214","messageId":"20200104051741.GJ9927@pobox.com","threadId":"52560","inReplyTo":"20200104004826.GC130883@google.com","subject":"Re: git checkout -","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2020-01-04T05:17:41Z","receivedAt":"2020-01-04T05:19:06Z","isPatch":false,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Hi,\n\nJonathan Nieder wrote:\n> Hi,\n> \n> François WAUQUIER wrote:\n> \n>> $ git checkout -\n>>\n>> I often use this command to go back to previous branch from my history.\n>> It is quite natural as it uses the same syntax as “cd -“\n>>\n>> But i found out it is not documented in\n>> https://git-scm.com/docs/git-checkout/2.24.0\n>> I report this to help others to discover this time saving command.\n> \n> Thanks for reporting!\n> \n> Ideas for what the documentation should say about it?  (Bonus points\n> if it comes in the form of a patch against Documentation/git-checkout.txt.\n> ;-)  See [1] for more about how that works.)\n\nNot to say that it can't possibly be improved, but it is\nmentioned in the git-checkout docs here[1].  The second\nparagraph in that section says:\n\n    You can use the @{-N} syntax to refer to the N-th last\n    branch/commit checked out using \"git checkout\"\n    operation. You may also specify - which is synonymous to\n    @{-1}.\n\nThis is also in the git-switch documentation, where it might\nbe easier to find, as it's very close to the beginning of\ngit-switch's man page, in the \"<start-point>\" entry of the\nOPTIONS section[2].\n\nBeing easy to miss in the git-checkout documentation might\nmake Duy smile; it shows the benefit of splitting some of\nthe many features of 'checkout' to the 'switch' command. :)\n\n[1] https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt-ltbranchgt\n[2] https://git-scm.com/docs/git-switch#Documentation/git-switch.txt-ltstart-pointgt\n\n-- \nTodd\n"}]}