{"thread":{"id":"51090","subject":"Missing branches after clone","startedAt":"2019-05-14T09:41:16Z","lastAt":"2019-05-19T00:09:39Z","messageCount":13,"participants":["Ulrich Windl","Duy Nguyen","Philip Oakley","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"375487","messageId":"5CDA8D37020000A100031319@gwsmtp.uni-regensburg.de","threadId":"51090","inReplyTo":null,"subject":"Missing branches after clone","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2019-05-14T09:41:11Z","receivedAt":"2019-05-14T09:41:16Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":"Hi!\n\nWhile wondering why some branches are not being displayed by \"git branch\" in a cloned repository, I was reading the obvious man pages (man git-branch, man git-remote), but still couldn't find the reason or the solution. Then I found https://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches which handles the subject...\nBut still the most common solution there still looks like an ugly hack.\nThus I suggest to improve the man-pages (unless done already)\nMy git is as old as 2.12.3, however...\n\nRegards,\nUlrich\n\n"},{"id":"375497","messageId":"CACsJy8AX9Wp3W=d1=ozF9nZXGE1muooMf7fKCtdOOi1g8QRmig@mail.gmail.com","threadId":"51090","inReplyTo":"5CDA8D37020000A100031319@gwsmtp.uni-regensburg.de","subject":"Re: Missing branches after clone","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-05-14T10:12:03Z","receivedAt":"2019-05-14T10:12:32Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, May 14, 2019 at 4:42 PM Ulrich Windl\n<Ulrich.Windl@rz.uni-regensburg.de> wrote:\n>\n> Hi!\n>\n> While wondering why some branches are not being displayed by \"git branch\" in a cloned repository, I was reading the obvious man pages (man git-branch, man git-remote), but still couldn't find the reason or the solution.\n\nLocal and remote branches are separate concepts. One big difference is\nremote branches will be automatically updated when you get updates\nfrom the remote repository, but local branches are only changed by\nyou.\n\nSo if you have to remote branches origin/master and origin/something.\nIf we automatically create the local branches 'master' and 'something'\nfor you, just so you can see it in 'git branch', then at the next 'git\nfetch' (or 'git pull'), we're going to have a problem. The local\nbranches will stay the same old values while origin/master and\norigin/something are kept uptodate. By the time you switch to and use\nbranch 'something'. there may be a surprise for you.\n\nBesides, tracking all remote branches only works well when you have\none remote repository. Once you have another one, things get\ncomplicated\n\n> Then I found https://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches which handles the subject...\n> But still the most common solution there still looks like an ugly hack.\n> Thus I suggest to improve the man-pages (unless done already)\n\nYeah I expected to see at least some definition of remote-tracking\nbranches (vs local ones) but I didn't see one. Room for improvement.\n-- \nDuy\n"},{"id":"375498","messageId":"0c9ec78a-9245-e1df-7ec6-a5d77d1a5261@iee.org","threadId":"51090","inReplyTo":"CACsJy8AX9Wp3W=d1=ozF9nZXGE1muooMf7fKCtdOOi1g8QRmig@mail.gmail.com","subject":"Re: Missing branches after clone","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2019-05-14T10:33:05Z","receivedAt":"2019-05-14T10:33:09Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Ulrich,\nOn 14/05/2019 11:12, Duy Nguyen wrote:\n>> Then I foundhttps://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches  which handles the subject...\n>> But still the most common solution there still looks like an ugly hack.\n>> Thus I suggest to improve the man-pages (unless done already)\n> Yeah I expected to see at least some definition of remote-tracking\n> branches (vs local ones) but I didn't see one. Room for improvement.\nYes, the 'remote tracking branch' name [RTB] is very 'French' in its \nbackwardness (see NATO/OTAN).\n\nIt is a 'branch which tracks a remote', and it is has the 'last time I \nlooked' state of the branch that is on the remote server, which may \nhave, by now, advanced or changed.\n\nSo you need to have the three distinct views in your head of 'My branch, \nheld locally', 'my copy of Their branch, from when I last looked', and \n'Their branch, on a remote server, in a state I haven't seen recently'.\n\nFinding a better name for the \"RTB\", one with an easier cognitive load \nfor those trying to understand Git, would be an improvement.\n\nThough there has been a similar issue with 'staging the index'. \nUltimately it is a new way of thinking about artefacts (perfect \nduplicates, no originals, no master, no copies, just verification \nhashes) so needs new terms and a difficult learning experience.\n-- \nPhilip\n"},{"id":"375502","messageId":"CACsJy8D9wDiTOfKP4sdMFQrR66qa4cLZuqqn32yH83_q0XjKRg@mail.gmail.com","threadId":"51090","inReplyTo":"0c9ec78a-9245-e1df-7ec6-a5d77d1a5261@iee.org","subject":"Re: Missing branches after clone","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-05-14T10:53:57Z","receivedAt":"2019-05-14T10:54:26Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, May 14, 2019 at 5:33 PM Philip Oakley <philipoakley@iee.org> wrote:\n>\n> Hi Ulrich,\n> On 14/05/2019 11:12, Duy Nguyen wrote:\n> >> Then I foundhttps://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches  which handles the subject...\n> >> But still the most common solution there still looks like an ugly hack.\n> >> Thus I suggest to improve the man-pages (unless done already)\n> > Yeah I expected to see at least some definition of remote-tracking\n> > branches (vs local ones) but I didn't see one. Room for improvement.\n> Yes, the 'remote tracking branch' name [RTB] is very 'French' in its\n> backwardness (see NATO/OTAN).\n\nThe name is not that bad to me.\n\n>\n> It is a 'branch which tracks a remote', and it is has the 'last time I\n> looked' state of the branch that is on the remote server, which may\n> have, by now, advanced or changed.\n>\n> So you need to have the three distinct views in your head of 'My branch,\n> held locally', 'my copy of Their branch, from when I last looked', and\n> 'Their branch, on a remote server, in a state I haven't seen recently'.\n\nWhat I was looking for is this. I don't think we have something like\nthis in the man pages (I only checked a few though) and not even sure\nwhere it should be if it should be added to the man pages, git-branch?\ngit-remote? git-fetch? git-branch.txt might be the best place because\nthis is still about branches.\n--\nDuy\n"},{"id":"375503","messageId":"aeb83b28-3db1-f37c-6cb0-6be5622da114@iee.org","threadId":"51090","inReplyTo":"CACsJy8D9wDiTOfKP4sdMFQrR66qa4cLZuqqn32yH83_q0XjKRg@mail.gmail.com","subject":"Re: Missing branches after clone","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2019-05-14T11:10:02Z","receivedAt":"2019-05-14T11:10:05Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Duy,\n\nOn 14/05/2019 11:53, Duy Nguyen wrote:\n> On Tue, May 14, 2019 at 5:33 PM Philip Oakley <philipoakley@iee.org> wrote:\n>> Hi Ulrich,\n>> On 14/05/2019 11:12, Duy Nguyen wrote:\n>>>> Then I foundhttps://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches  which handles the subject...\n>>>> But still the most common solution there still looks like an ugly hack.\n>>>> Thus I suggest to improve the man-pages (unless done already)\n>>> Yeah I expected to see at least some definition of remote-tracking\n>>> branches (vs local ones) but I didn't see one. Room for improvement.\n>> Yes, the 'remote tracking branch' name [RTB] is very 'French' in its\n>> backwardness (see NATO/OTAN).\n> The name is not that bad to me.\nIt was something that I struggled with initially, and its sounds like \nUlrich had a similar issue.\n\nI expect that those who grow up with the development of Git have an \norganic knowledge that is deeply rooted so the terms will be solidly \nfounded for them (along with many other terms and implementation details \nthat catch me out ;-).\n>> It is a 'branch which tracks a remote', and it is has the 'last time I\n>> looked' state of the branch that is on the remote server, which may\n>> have, by now, advanced or changed.\n>>\n>> So you need to have the three distinct views in your head of 'My branch,\n>> held locally', 'my copy of Their branch, from when I last looked', and\n>> 'Their branch, on a remote server, in a state I haven't seen recently'.\n> What I was looking for is this. I don't think we have something like\n> this in the man pages (I only checked a few though) and not even sure\n> where it should be if it should be added to the man pages, git-branch?\n> git-remote? git-fetch? git-branch.txt might be the best place because\n> this is still about branches.\n>\nAt the moment its in `git help glossary`, but could be improved, and \nreferences to it given in the various man pages.\n--\nPhilip\n"},{"id":"375514","messageId":"5CDAAB56020000A100031334@gwsmtp.uni-regensburg.de","threadId":"51090","inReplyTo":"0c9ec78a-9245-e1df-7ec6-a5d77d1a5261@iee.org","subject":"Antw: Re: Missing branches after clone","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2019-05-14T11:49:42Z","receivedAt":"2019-05-14T11:49:48Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":"Hi!\n\nThe confusing part actually is for me:\n\"git clone\" does NOT \"Clone a repository into a new directory\", but \"clone the current branch into a new directory\" (IMHO).\nSo I was surprised that I couldn't merge branches under the same name in the cloned \"repository\".\nOnly \"git clone --bare\" actually seems to clone \"the repository\".\nI think this is very confusing to new users. At least I didn't quite get the reasoning for that.\n\nRegards,\nUlrich\n\n\n>>> Philip Oakley <philipoakley@iee.org> schrieb am 14.05.2019 um 12:33 in\nNachricht <0c9ec78a-9245-e1df-7ec6-a5d77d1a5261@iee.org>:\n> Hi Ulrich,\n> On 14/05/2019 11:12, Duy Nguyen wrote:\n>>> Then I \n> foundhttps://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branch\n> es  which handles the subject...\n>>> But still the most common solution there still looks like an ugly hack.\n>>> Thus I suggest to improve the man-pages (unless done already)\n>> Yeah I expected to see at least some definition of remote-tracking\n>> branches (vs local ones) but I didn't see one. Room for improvement.\n> Yes, the 'remote tracking branch' name [RTB] is very 'French' in its \n> backwardness (see NATO/OTAN).\n> \n> It is a 'branch which tracks a remote', and it is has the 'last time I \n> looked' state of the branch that is on the remote server, which may \n> have, by now, advanced or changed.\n> \n> So you need to have the three distinct views in your head of 'My branch, \n> held locally', 'my copy of Their branch, from when I last looked', and \n> 'Their branch, on a remote server, in a state I haven't seen recently'.\n> \n> Finding a better name for the \"RTB\", one with an easier cognitive load \n> for those trying to understand Git, would be an improvement.\n> \n> Though there has been a similar issue with 'staging the index'. \n> Ultimately it is a new way of thinking about artefacts (perfect \n> duplicates, no originals, no master, no copies, just verification \n> hashes) so needs new terms and a difficult learning experience.\n> -- \n> Philip\n\n\n\n\n"},{"id":"375587","messageId":"xmqq5zqc8ozn.fsf@gitster-ct.c.googlers.com","threadId":"51090","inReplyTo":"0c9ec78a-9245-e1df-7ec6-a5d77d1a5261@iee.org","subject":"Re: Missing branches after clone","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-05-15T01:50:52Z","receivedAt":"2019-05-15T01:50:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Philip Oakley <philipoakley@iee.org> writes:\n\n> It is a 'branch which tracks a remote', and it is has the 'last time I\n> looked' state of the branch that is on the remote server, which may\n> have, by now, advanced or changed.\n\nYup, I thought we long time ago decided to discourage use of \"remote\nbranch(es)\" in our documentation to help unconfuse users and stick\nto the term \"a remote-tracking branch\" (the \"remote-tracking\" is a\nhyphenated one word)?\n\n> So you need to have the three distinct views in your head of 'My\n> branch, held locally', 'my copy of Their branch, from when I last\n> looked', and 'Their branch, on a remote server, in a state I haven't\n> seen recently'.\n\nYup.  FWIW, when I need to refer to the last one, I'd always say \"a\nbranch at the remote\" to avoid the confusing term \"remote branch\".\n\n"},{"id":"375604","messageId":"a05fb45a-69d7-a12b-e76c-f11e985f4a65@iee.org","threadId":"51090","inReplyTo":"xmqq5zqc8ozn.fsf@gitster-ct.c.googlers.com","subject":"Re: Missing branches after clone","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2019-05-15T07:13:19Z","receivedAt":"2019-05-15T07:13:21Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 15/05/2019 02:50, Junio C Hamano wrote:\n> Philip Oakley <philipoakley@iee.org> writes:\n>\n>> It is a 'branch which tracks a remote', and it is has the 'last time I\n>> looked' state of the branch that is on the remote server, which may\n>> have, by now, advanced or changed.\n> Yup, I thought we long time ago decided to discourage use of \"remote\n> branch(es)\" in our documentation to help unconfuse users and stick\n> to the term \"a remote-tracking branch\" (the \"remote-tracking\" is a\n> hyphenated one word)?\nI believe we are consistent in using the 'rtb' phrase (I've not checked \nthe hyphen), but for those uninitiated in the duplicitous ways of \ndistributed versioning systems, they can still think that the phrase is \nsimply saying that local branch A will be updated to the state of remote \nbranch B when do a fetch from that remote.\n\nI.e. they think tracking is a direct linkage via fetch, rather than an \nindirect linkage via a local rtb (a concept that has not yet entered \ntheir head, and if if they are aware of the possibility, they haven't \njoined the dots). Hence my spelling it out the 'French' way.\n>> So you need to have the three distinct views in your head of 'My\n>> branch, held locally', 'my copy of Their branch, from when I last\n>> looked', and 'Their branch, on a remote server, in a state I haven't\n>> seen recently'.\n> Yup.  FWIW, when I need to refer to the last one, I'd always say \"a\n> branch at the remote\" to avoid the confusing term \"remote branch\".\n>\nyes, it's tricky. I've shot my foot off a number of times.\nThanks\nPhilip\n"},{"id":"375605","messageId":"b75bd892-b216-3c7d-f9e7-4470300e02fc@iee.org","threadId":"51090","inReplyTo":"5CDAAB56020000A100031334@gwsmtp.uni-regensburg.de","subject":"Re: Antw: Re: Missing branches after clone","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2019-05-15T07:34:17Z","receivedAt":"2019-05-15T07:34:19Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 14/05/2019 12:49, Ulrich Windl wrote:\n> Hi!\n>\n> The confusing part actually is for me:\n> \"git clone\" does NOT \"Clone a repository into a new directory\", but \"clone the current branch into a new directory\" (IMHO).\n> So I was surprised that I couldn't merge branches under the same name in the cloned \"repository\".\n> Only \"git clone --bare\" actually seems to clone \"the repository\".\n> I think this is very confusing to new users. At least I didn't quite get the reasoning for that.\nIt's that you are missing the idea behind the \"Branches that track the \nremote\", which are local copies, but not YOUR branches. see below.\nI clone the GitHub test repo. I get (a copy of) it all (the rtb's). Git \n_creates_ a local branch 'master' for me. Git checks out the lead remote \nbranch into it. Command prompt returns. I cd into the new repo. I ask \nwhat branches _I_ have - just 'master'. I ask about all the branches the \nrepo has - voila, I see all those rtb's in _my_ repo. They are all \nperfectly valid branch refs.\n\nIt will take a little while to appreciate this extra layer and how to \nuse it, and how Git can 'dwim' (do what I mean) the usage of shortened \nrefs and branch names, so it you try checking out 'change-the-title', \ngit will know to fall back to using the rtb if you haven't created a \nlocal version.\nHope That Helps.\nPhilip\n\nphili@Philip-Win10 MINGW64 / (master)\n$ cd usr/src\n\nphili@Philip-Win10 MINGW64 /usr/src (master)\n$ git clone https://github.com/octocat/Spoon-Knife.git\nCloning into 'Spoon-Knife'...\nremote: Enumerating objects: 16, done.\nremote: Total 16 (delta 0), reused 0 (delta 0), pack-reused 16\nUnpacking objects: 100% (16/16), done.\n\nphili@Philip-Win10 MINGW64 /usr/src (master)\n$ cd Spoon-Knife/\n\nphili@Philip-Win10 MINGW64 /usr/src/Spoon-Knife (master)\n$ git branch\n* master\n\nphili@Philip-Win10 MINGW64 /usr/src/Spoon-Knife (master)\n$ git branch -a\n* master\n   remotes/origin/HEAD -> origin/master\n   remotes/origin/change-the-title\n   remotes/origin/master\n   remotes/origin/test-branch\n\nphili@Philip-Win10 MINGW64 /usr/src/Spoon-Knife (master)\n$\n\n--\nPS What change to the [clone?] man page would have helped you here?\n\n>> Philip Oakley <philipoakley@iee.org> schrieb am 14.05.2019 um 12:33 in\n> Nachricht <0c9ec78a-9245-e1df-7ec6-a5d77d1a5261@iee.org>:\n>> Hi Ulrich,\n>> On 14/05/2019 11:12, Duy Nguyen wrote:\n>>>> Then I\n>> foundhttps://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branch\n>> es  which handles the subject...\n>>>> But still the most common solution there still looks like an ugly hack.\n>>>> Thus I suggest to improve the man-pages (unless done already)\n>>> Yeah I expected to see at least some definition of remote-tracking\n>>> branches (vs local ones) but I didn't see one. Room for improvement.\n>> Yes, the 'remote tracking branch' name [RTB] is very 'French' in its\n>> backwardness (see NATO/OTAN).\n>>\n>> It is a 'branch which tracks a remote', and it is has the 'last time I\n>> looked' state of the branch that is on the remote server, which may\n>> have, by now, advanced or changed.\n>>\n>> So you need to have the three distinct views in your head of 'My branch,\n>> held locally', 'my copy of Their branch, from when I last looked', and\n>> 'Their branch, on a remote server, in a state I haven't seen recently'.\n>>\n>> Finding a better name for the \"RTB\", one with an easier cognitive load\n>> for those trying to understand Git, would be an improvement.\n>>\n>> Though there has been a similar issue with 'staging the index'.\n>> Ultimately it is a new way of thinking about artefacts (perfect\n>> duplicates, no originals, no master, no copies, just verification\n>> hashes) so needs new terms and a difficult learning experience.\n>> -- \n>> Philip\n>\n>\n>\n\n"},{"id":"375611","messageId":"5CDBD199020000A10003136F@gwsmtp.uni-regensburg.de","threadId":"51090","inReplyTo":"b75bd892-b216-3c7d-f9e7-4470300e02fc@iee.org","subject":"Re: Antw: Re: Missing branches after clone","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2019-05-15T08:45:13Z","receivedAt":"2019-05-15T08:45:20Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":">>> Philip Oakley <philipoakley@iee.org> schrieb am 15.05.2019 um 09:34 in\nNachricht <b75bd892-b216-3c7d-f9e7-4470300e02fc@iee.org>:\n> On 14/05/2019 12:49, Ulrich Windl wrote:\n>> Hi!\n>>\n>> The confusing part actually is for me:\n>> \"git clone\" does NOT \"Clone a repository into a new directory\", but \"clone\n\n> the current branch into a new directory\" (IMHO).\n>> So I was surprised that I couldn't merge branches under the same name in\nthe \n> cloned \"repository\".\n>> Only \"git clone --bare\" actually seems to clone \"the repository\".\n>> I think this is very confusing to new users. At least I didn't quite get\nthe \n> reasoning for that.\n> It's that you are missing the idea behind the \"Branches that track the \n> remote\", which are local copies, but not YOUR branches. see below.\n> I clone the GitHub test repo. I get (a copy of) it all (the rtb's). Git \n> _creates_ a local branch 'master' for me. Git checks out the lead remote \n> branch into it. Command prompt returns. I cd into the new repo. I ask \n> what branches _I_ have - just 'master'. I ask about all the branches the \n> repo has - voila, I see all those rtb's in _my_ repo. They are all \n> perfectly valid branch refs.\n\nYes, I can mostly follow you there with one exception: In the cloned\nrepository the branches are not available under the same name as in the\noriginal repository (unless I'm totally confused). Therefore a beginner would\nsimply assume \"they are missing\".\nI knew that (which was my use case) git optimizes local copies by linking as\nmuch as possible, but I don't understand why cloned branches are \"soooo\ncomplicated\". (I could understand it as an optimization for network copies)\n\n> \n> It will take a little while to appreciate this extra layer and how to \n> use it, and how Git can 'dwim' (do what I mean) the usage of shortened \n> refs and branch names, so it you try checking out 'change-the-title', \n> git will know to fall back to using the rtb if you haven't created a \n> local version.\n> Hope That Helps.\n> Philip\n> \n> phili@Philip-Win10 MINGW64 / (master)\n> $ cd usr/src\n> \n> phili@Philip-Win10 MINGW64 /usr/src (master)\n> $ git clone https://github.com/octocat/Spoon-Knife.git \n> Cloning into 'Spoon-Knife'...\n> remote: Enumerating objects: 16, done.\n> remote: Total 16 (delta 0), reused 0 (delta 0), pack-reused 16\n> Unpacking objects: 100% (16/16), done.\n> \n> phili@Philip-Win10 MINGW64 /usr/src (master)\n> $ cd Spoon-Knife/\n> \n> phili@Philip-Win10 MINGW64 /usr/src/Spoon-Knife (master)\n> $ git branch\n> * master\n> \n> phili@Philip-Win10 MINGW64 /usr/src/Spoon-Knife (master)\n> $ git branch -a\n> * master\n>    remotes/origin/HEAD -> origin/master\n>    remotes/origin/change-the-title\n>    remotes/origin/master\n>    remotes/origin/test-branch\n> \n> phili@Philip-Win10 MINGW64 /usr/src/Spoon-Knife (master)\n> $\n> \n> --\n> PS What change to the [clone?] man page would have helped you here?\n\nMaybe confirm this: At this state I could \"checkout test-branch\" (for\nexample), but I could not \"merge test-branch\", right?\n(Another level of confusion is bash-completion which does not know those\nhidden branches)\n\nOK, reading git-clone again, the following might apply:\nExplain (or refer to) what a \"remote-tracking branch\" is.\n\n\"checks out an initial branch that is forked from the cloned repository’s\ncurrently active branch\" could be simplified to \"checks out the active branch\nin the cloned repository\"?\n\nMaybe add a paragraph at the end of the DESCRIPTION starting like: \"To use\nanother branch in the clones repository...\"\n\nMaybe also add a pointer to the meanings of \"origin\" and \"remote\" (I know that\nthe clone source becomes remote/origin)\n\nI wonder whether \"This default configuration is achieved by creating\nreferences to the\nremote branch heads under refs/remotes/origin and by initializing\nremote.origin.url and remote.origin.fetch configuration variables.\" should\nbecome \"The original repository's URL will be visible as remote/origin in the\ncloned reporitory\"\n\nMaybe point out the differences between a \"default clone\" mand a \"--mirror\nclone\" in the DESCRIPTION.\n\nThe example \"Clone from upstream while borrowing from an existing local\ndirectory:\" could benefit from a few explaining words (why would one want to do\nthat, i.e. what's the effect?)\n\nNone of the examples refers to using another branch than the default branch.\nMaybe add two examples:\n1: checking out a different branch, 2:merging a different branch to the\ncurrent one\n\nThat's what I think.\n\nRegards,\nUlrich\n\n\n> \n>>> Philip Oakley <philipoakley@iee.org> schrieb am 14.05.2019 um 12:33 in\n>> Nachricht <0c9ec78a-9245-e1df-7ec6-a5d77d1a5261@iee.org>:\n>>> Hi Ulrich,\n>>> On 14/05/2019 11:12, Duy Nguyen wrote:\n>>>>> Then I\n>>> \n>\nfoundhttps://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branch\n>>> es  which handles the subject...\n>>>>> But still the most common solution there still looks like an ugly hack.\n>>>>> Thus I suggest to improve the man-pages (unless done already)\n>>>> Yeah I expected to see at least some definition of remote-tracking\n>>>> branches (vs local ones) but I didn't see one. Room for improvement.\n>>> Yes, the 'remote tracking branch' name [RTB] is very 'French' in its\n>>> backwardness (see NATO/OTAN).\n>>>\n>>> It is a 'branch which tracks a remote', and it is has the 'last time I\n>>> looked' state of the branch that is on the remote server, which may\n>>> have, by now, advanced or changed.\n>>>\n>>> So you need to have the three distinct views in your head of 'My branch,\n>>> held locally', 'my copy of Their branch, from when I last looked', and\n>>> 'Their branch, on a remote server, in a state I haven't seen recently'.\n>>>\n>>> Finding a better name for the \"RTB\", one with an easier cognitive load\n>>> for those trying to understand Git, would be an improvement.\n>>>\n>>> Though there has been a similar issue with 'staging the index'.\n>>> Ultimately it is a new way of thinking about artefacts (perfect\n>>> duplicates, no originals, no master, no copies, just verification\n>>> hashes) so needs new terms and a difficult learning experience.\n>>> -- \n>>> Philip\n>>\n>>\n>>\n\n\n\n"},{"id":"375628","messageId":"90bcfd4a-5fc3-69e2-5c7e-1abbbc03e09b@iee.org","threadId":"51090","inReplyTo":"5CDBD199020000A10003136F@gwsmtp.uni-regensburg.de","subject":"Re: Antw: Re: Missing branches after clone","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2019-05-15T13:07:09Z","receivedAt":"2019-05-15T13:07:12Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 15/05/2019 09:45, Ulrich Windl wrote:\n>> reasoning for that.\n>> It's that you are missing the idea behind the \"Branches that track the\n>> remote\", which are local copies, but not YOUR branches. see below.\n>> I clone the GitHub test repo. I get (a copy of) it all (the rtb's). Git\n>> _creates_ a local branch 'master' for me. Git checks out the lead remote\n>> branch into it. Command prompt returns. I cd into the new repo. I ask\n>> what branches _I_ have - just 'master'. I ask about all the branches the\n>> repo has - voila, I see all those rtb's in _my_ repo. They are all\n>> perfectly valid branch refs.\n> Yes, I can mostly follow you there with one exception: In the cloned\n> repository the branches are not available under the same name as in the\n> original repository (unless I'm totally confused). Therefore a beginner would\n> simply assume \"they are missing\".\n> I knew that (which was my use case) git optimizes local copies by linking as\n> much as possible, but I don't understand why cloned branches are \"soooo\n> complicated\". (I could understand it as an optimization for network copies)\n\nMy use case is that I help on the Git-for-Windows development. So I have \n4 upstream repositories I need to look at:\nGit, Junio-git (maintainer), Git-For-Windows, and Dscho-git (gfw \nmaintainer).\n\nAll of them have a 'master' branch - so I can't have 4 different local \n'master' branches. So, because of history, and hassles Dscho et. al. had \nhad to use 'develop', instead of 'master' for their lead branch name, \nbut now they are all 'master'. So I just copied that for a while.\n\nMeanwhile I more recently learned that I could simply start my new \nfeature branches direct from the remote tracking branches (which are \nlocal!), and don't actually need a master branch at all!!  But it took a \nlong time for it all to click into place in my brain. I've have 50+ \nyears of the 'old masters' idea of there being a single unique master \nartefact with all other being second rate copies. Now it's all \nduplicates verified by hashes.\n>> It will take a little while to appreciate this extra layer and how to\n>> use it, and how Git can 'dwim' (do what I mean) the usage of shortened\n>> refs and branch names, so it you try checking out 'change-the-title',\n>> git will know to fall back to using the rtb if you haven't created a\n>> local version.\n>> Hope That Helps.\n>> Philip\n>>\n>> phili@Philip-Win10 MINGW64 / (master)\n>> $ cd usr/src\n>>\n>> phili@Philip-Win10 MINGW64 /usr/src (master)\n>> $ git clone https://github.com/octocat/Spoon-Knife.git\n>> Cloning into 'Spoon-Knife'...\n>> remote: Enumerating objects: 16, done.\n>> remote: Total 16 (delta 0), reused 0 (delta 0), pack-reused 16\n>> Unpacking objects: 100% (16/16), done.\n>>\n>> phili@Philip-Win10 MINGW64 /usr/src (master)\n>> $ cd Spoon-Knife/\n>>\n>> phili@Philip-Win10 MINGW64 /usr/src/Spoon-Knife (master)\n>> $ git branch\n>> * master\n>>\n>> phili@Philip-Win10 MINGW64 /usr/src/Spoon-Knife (master)\n>> $ git branch -a\n>> * master\n>>     remotes/origin/HEAD -> origin/master\n>>     remotes/origin/change-the-title\n>>     remotes/origin/master\n>>     remotes/origin/test-branch\n>>\n>> phili@Philip-Win10 MINGW64 /usr/src/Spoon-Knife (master)\n>> $\n>>\n>> --\n>> PS What change to the [clone?] man page would have helped you here?\n> Maybe confirm this: At this state I could \"checkout test-branch\" (for\n> example), but I could not \"merge test-branch\", right?\n> (Another level of confusion is bash-completion which does not know those\n> hidden branches)\nfor completion, use the remote name first. If the action may be \nambiguous or dangerous because of Dwimming, then git tends to avoid \ndoing it..\n>\n> OK, reading git-clone again, the following might apply:\n> Explain (or refer to) what a \"remote-tracking branch\" is.\nInterestingly, try 'git help glossary' to see the glossary of terms. \nTheir are other useful guides that can be access by the same method. \n`git help -g` will list them.\n>\n> \"checks out an initial branch that is forked from the cloned repository’s\n> currently active branch\" could be simplified to \"checks out the active branch\n> in the cloned repository\"?\n>\n> Maybe add a paragraph at the end of the DESCRIPTION starting like: \"To use\n> another branch in the clones repository...\"\n>\n> Maybe also add a pointer to the meanings of \"origin\" and \"remote\" (I know that\n> the clone source becomes remote/origin)\n>\n> I wonder whether \"This default configuration is achieved by creating\n> references to the\n> remote branch heads under refs/remotes/origin and by initializing\n> remote.origin.url and remote.origin.fetch configuration variables.\" should\n> become \"The original repository's URL will be visible as remote/origin in the\n> cloned reporitory\"\n>\n> Maybe point out the differences between a \"default clone\" mand a \"--mirror\n> clone\" in the DESCRIPTION.\n>\n> The example \"Clone from upstream while borrowing from an existing local\n> directory:\" could benefit from a few explaining words (why would one want to do\n> that, i.e. what's the effect?)\n>\n> None of the examples refers to using another branch than the default branch.\n> Maybe add two examples:\n> 1: checking out a different branch, 2:merging a different branch to the\n> current one\n>\n> That's what I think.\n>\n> Regards,\n> Ulrich\n>\n>\nThanks\n"},{"id":"375851","messageId":"CACsJy8Cc+cj0kC5=N+6AGB2UGDWA3uK946vgdhg9Cpx9a7w2wg@mail.gmail.com","threadId":"51090","inReplyTo":"aeb83b28-3db1-f37c-6cb0-6be5622da114@iee.org","subject":"Re: Missing branches after clone","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-05-18T12:17:49Z","receivedAt":"2019-05-18T12:18:19Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, May 14, 2019 at 6:10 PM Philip Oakley <philipoakley@iee.org> wrote:\n> >> It is a 'branch which tracks a remote', and it is has the 'last time I\n> >> looked' state of the branch that is on the remote server, which may\n> >> have, by now, advanced or changed.\n> >>\n> >> So you need to have the three distinct views in your head of 'My branch,\n> >> held locally', 'my copy of Their branch, from when I last looked', and\n> >> 'Their branch, on a remote server, in a state I haven't seen recently'.\n> > What I was looking for is this. I don't think we have something like\n> > this in the man pages (I only checked a few though) and not even sure\n> > where it should be if it should be added to the man pages, git-branch?\n> > git-remote? git-fetch? git-branch.txt might be the best place because\n> > this is still about branches.\n> >\n> At the moment its in `git help glossary`, but could be improved, and\n> references to it given in the various man pages.\n\nIt does not look easy to link to a specific term/section between man\npages. The way user-manual.html does it is to embed the whole\nglossary.\n\nI suppose we could still do something similar after breaking down\nglossary.txt (like we do with config.txt) the only include relevant\nterms. Not sure if this a really good idea to pursue.\n-- \nDuy\n"},{"id":"375862","messageId":"033ba463-dddd-d5b8-903c-9729190c213a@iee.org","threadId":"51090","inReplyTo":"CACsJy8Cc+cj0kC5=N+6AGB2UGDWA3uK946vgdhg9Cpx9a7w2wg@mail.gmail.com","subject":"Re: Missing branches after clone","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2019-05-19T00:09:35Z","receivedAt":"2019-05-19T00:09:39Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 18/05/2019 13:17, Duy Nguyen wrote:\n> On Tue, May 14, 2019 at 6:10 PM Philip Oakley <philipoakley@iee.org> wrote:\n>>>> It is a 'branch which tracks a remote', and it is has the 'last time I\n>>>> looked' state of the branch that is on the remote server, which may\n>>>> have, by now, advanced or changed.\n>>>>\n>>>> So you need to have the three distinct views in your head of 'My branch,\n>>>> held locally', 'my copy of Their branch, from when I last looked', and\n>>>> 'Their branch, on a remote server, in a state I haven't seen recently'.\n>>> What I was looking for is this. I don't think we have something like\n>>> this in the man pages (I only checked a few though) and not even sure\n>>> where it should be if it should be added to the man pages, git-branch?\n>>> git-remote? git-fetch? git-branch.txt might be the best place because\n>>> this is still about branches.\n>>>\n>> At the moment its in `git help glossary`, but could be improved, and\n>> references to it given in the various man pages.\n> It does not look easy to link to a specific term/section between man\n> pages. The way user-manual.html does it is to embed the whole\n> glossary.\n>\n> I suppose we could still do something similar after breaking down\n> glossary.txt (like we do with config.txt) the only include relevant\n> terms. Not sure if this a really good idea to pursue.\nMainly I was commenting on the fact that the description is in a guide \n(which isn't well known).\nAnd that we rarely give links to the guides.\nFor those that end up using the HTML man pages, having hyperlinks to the \nparticular section would be useful, though I'm not sure if their is a \nneat way of doing that which is 'nice' for those using the 'man' viewer.\nSo yes, it's more of a back burner issue, unless some eager tech authors \nsuddenly show up;-)\n--\nPhilip\n"}]}