{"thread":{"id":"50611","subject":"Tags from each remote in a separate \"name-space\"?","startedAt":"2019-02-28T06:03:05Z","lastAt":"2019-03-01T14:51:09Z","messageCount":3,"participants":["Sergey Organov","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"370349","messageId":"87d0ncihkg.fsf@javad.com","threadId":"50611","inReplyTo":null,"subject":"Tags from each remote in a separate \"name-space\"?","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2019-02-28T05:54:23Z","receivedAt":"2019-02-28T06:03:05Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"Hello,\n\nHow do I configure git to handle tags from remotes in a manner similar\nto branches?\n\nSpecifically, I want tag 'tag_name' from remote 'origin' to have local\nname 'origin/tag_name', not 'tag_name', as it is by default. For a repo\nwith a lot of remotes[*] it would allow to keep track of what tag came from\nwhere, as well as prevent name conflicts between tags from different\nremotes (and/or local tags).\n\nFetch-only solution ('fetch', 'pull', and 'remote update' support only)\nwould do, though push support would be interesting to have as well, so\nthat, say\n\n$ git push origin/tag_name\n\nworks as\n\n$ git push origin origin/tag_name:refs/tags/tag_name\n\nAm I dreaming, or is it already supported?\n\n[*] I ran into it managing Linux kernel sources for different ARM\narchitectures. Mainstream Linux plus stable Linux plus 2 vendor-specific\nremotes plus 3 our local remotes made a mess of various tags in the\nrepository.\n\n-- Sergey\n"},{"id":"370354","messageId":"20190228081103.GA22075@dektop","threadId":"50611","inReplyTo":"87d0ncihkg.fsf@javad.com","subject":"Re: Tags from each remote in a separate \"name-space\"?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-02-28T08:11:03Z","receivedAt":"2019-02-28T08:11:10Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, Feb 28, 2019 at 08:54:23AM +0300, Sergey Organov wrote:\n> Hello,\n> \n> How do I configure git to handle tags from remotes in a manner similar\n> to branches?\n> \n> Specifically, I want tag 'tag_name' from remote 'origin' to have local\n> name 'origin/tag_name', not 'tag_name', as it is by default. For a repo\n> with a lot of remotes[*] it would allow to keep track of what tag came from\n> where, as well as prevent name conflicts between tags from different\n> remotes (and/or local tags).\n\nOn the fetch side, something like this in the config file (assuming\n\"origin\" remote here) probably would do\n\n[remote \"origin\"]\n\tfetch = +refs/tags/*:refs/tags/origin/*\n\ttagOpt = --no-tags\n\nI'm not so sure about the push side.\n\nPS. it would be nice if \"git remote\" has --no-shared-tags option or\nsomething to do this, assuming that it works perfectly well.\n--\nDuy\n"},{"id":"370418","messageId":"87wolizm07.fsf@javad.com","threadId":"50611","inReplyTo":"20190228081103.GA22075@dektop","subject":"Re: Tags from each remote in a separate \"name-space\"?","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2019-03-01T14:51:04Z","receivedAt":"2019-03-01T14:51:09Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n> On Thu, Feb 28, 2019 at 08:54:23AM +0300, Sergey Organov wrote:\n>> Hello,\n>> \n>> How do I configure git to handle tags from remotes in a manner similar\n>> to branches?\n>> \n>> Specifically, I want tag 'tag_name' from remote 'origin' to have local\n>> name 'origin/tag_name', not 'tag_name', as it is by default. For a repo\n>> with a lot of remotes[*] it would allow to keep track of what tag came from\n>> where, as well as prevent name conflicts between tags from different\n>> remotes (and/or local tags).\n>\n> On the fetch side, something like this in the config file (assuming\n> \"origin\" remote here) probably would do\n>\n> [remote \"origin\"]\n> \tfetch = +refs/tags/*:refs/tags/origin/*\n> \ttagOpt = --no-tags\n\nThanks for the clue, Duy!\n\nJust adding\n\n\tfetch = +refs/tags/*:refs/tags/origin/*\n\nfor each existing remote configuration seems to do the trick indeed.\n\nNow I wonder if it would make sense to implement something like\n\n  $ git remote add --separate-tags ...\n\nto be able to auto-configure this.\n\n-- \nSergey\n"}]}