{"thread":{"id":"21621","subject":"pushing remote branches","startedAt":"2009-11-14T23:37:04Z","lastAt":"2009-11-16T20:05:13Z","messageCount":6,"participants":["Lorenzo Bettini","Sitaram Chamarty","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"127570","messageId":"hdneuv$nc8$2@ger.gmane.org","threadId":"21621","inReplyTo":null,"subject":"pushing remote branches","fromName":"Lorenzo Bettini","fromEmail":"bettini@dsi.unifi.it","sentAt":"2009-11-14T23:37:04Z","receivedAt":"2009-11-14T23:37:04Z","isPatch":false,"sender":{"key":"bettini@dsi.unifi.it","avatar":"https://gravatar.com/avatar/05ca421365c7ab6093049d1b9fe36e4375a5ea67adf8e09d7c993ff754e84b7f?d=mp&s=160"},"body":"Hi\n\nI recently started to use git, and I experienced problems with branches: \non my machine I did (on an already cloned repo)\n\ngit checkout -b experiments origin/experiments\n\nand thus my config reads\n\n[remote \"origin\"]\n         fetch = +refs/heads/*:refs/remotes/origin/*\n         url = git://...\n[branch \"master\"]\n         remote = origin\n         merge = refs/heads/master\n[branch \"experiments\"]\n         remote = origin\n         merge = refs/heads/experiments\n\nisn't this enough to be able to push the experiments branch?\n\nI tried\n\ngit push origin experiments\n\nIt tells me that it is a read-only url...\n\nafter adding\n\n[remote \"experiments\"]\n         url = git@...\n         fetch = \n+refs/heads/experiments:refs/remotes/experiments/experiments\n\nI can now push that branch with\n\ngit push experiments experiments\n\nbut I was wondering whether the initial config wasn't enough...\n\nmany thanks in advance\n\tLorenzo\n\n-- \nLorenzo Bettini, PhD in Computer Science, DI, Univ. Torino\nICQ# lbetto, 16080134     (GNU/Linux User # 158233)\nHOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com\nhttp://www.myspace.com/supertrouperabba\nBLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com\nhttp://www.gnu.org/software/src-highlite\nhttp://www.gnu.org/software/gengetopt\nhttp://www.gnu.org/software/gengen http://doublecpp.sourceforge.net\n"},{"id":"127574","messageId":"2e24e5b90911141645n59680856ja21f2f3c7063f7c0@mail.gmail.com","threadId":"21621","inReplyTo":"hdneuv$nc8$2@ger.gmane.org","subject":"Re: pushing remote branches","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-11-15T00:45:00Z","receivedAt":"2009-11-15T00:45:00Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"Hi Lorenzo,\n\nOn Sun, Nov 15, 2009 at 5:07 AM, Lorenzo Bettini <bettini@dsi.unifi.it> wrote:\n\n>            url = git://...\n\n> isn't this enough to be able to push the experiments branch?\n\nnot normally.\n\nThe \"git://\" protocol is a read-only protocol by default.  Since it is\ncompletely unauthenticated, enabling push via git:// is not a good idea in\ngeneral.\n\n>            url = git@...\n\nThis is a shortcut for something like ssh://git@..., which then allows write\nalso.\n"},{"id":"127602","messageId":"hdoko1$s78$1@ger.gmane.org","threadId":"21621","inReplyTo":"2e24e5b90911141645n59680856ja21f2f3c7063f7c0@mail.gmail.com","subject":"Re: pushing remote branches","fromName":"Lorenzo Bettini","fromEmail":"bettini@dsi.unifi.it","sentAt":"2009-11-15T10:21:53Z","receivedAt":"2009-11-15T10:21:53Z","isPatch":false,"sender":{"key":"bettini@dsi.unifi.it","avatar":"https://gravatar.com/avatar/05ca421365c7ab6093049d1b9fe36e4375a5ea67adf8e09d7c993ff754e84b7f?d=mp&s=160"},"body":"Sitaram Chamarty wrote:\n> Hi Lorenzo,\n> \n> On Sun, Nov 15, 2009 at 5:07 AM, Lorenzo Bettini <bettini@dsi.unifi.it> wrote:\n> \n>>            url = git://...\n> \n>> isn't this enough to be able to push the experiments branch?\n> \n> not normally.\n> \n> The \"git://\" protocol is a read-only protocol by default.  Since it is\n> completely unauthenticated, enabling push via git:// is not a good idea in\n> general.\n\nso probably I managed to push origin master anyway because gitorious \nasked me for my ssh passphrase?\n\n> \n>>            url = git@...\n> \n> This is a shortcut for something like ssh://git@..., which then allows write\n> also.\n\nThus, if I had\n\n[remote \"origin\"]\n         fetch = +refs/heads/*:refs/remotes/origin/*\n         url = git@...\n[branch \"master\"]\n         remote = origin\n         merge = refs/heads/master\n[branch \"experiments\"]\n         remote = origin\n         merge = refs/heads/experiments\n\ninstead of\n\n[remote \"origin\"]\n         fetch = +refs/heads/*:refs/remotes/origin/*\n         url = git://...\n[branch \"master\"]\n         remote = origin\n         merge = refs/heads/master\n[branch \"experiments\"]\n         remote = origin\n         merge = refs/heads/experiments\n\nI would have been able to push also to branch experiments?  Without \nhaving to add\n\n[remote \"experiments\"]\n         url = git@...\n         fetch = \n+refs/heads/experiments:refs/remotes/experiments/experiments\n\n?\n\nthanks in advance\n\tLorenzo\n\n-- \nLorenzo Bettini, PhD in Computer Science, DI, Univ. Torino\nICQ# lbetto, 16080134     (GNU/Linux User # 158233)\nHOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com\nhttp://www.myspace.com/supertrouperabba\nBLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com\nhttp://www.gnu.org/software/src-highlite\nhttp://www.gnu.org/software/gengetopt\nhttp://www.gnu.org/software/gengen http://doublecpp.sourceforge.net\n"},{"id":"127604","messageId":"2e24e5b90911150304i1472ed13k6c60611ef2e9ba19@mail.gmail.com","threadId":"21621","inReplyTo":"hdoko1$s78$1@ger.gmane.org","subject":"Re: pushing remote branches","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-11-15T11:04:13Z","receivedAt":"2009-11-15T11:04:13Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Sun, Nov 15, 2009 at 3:51 PM, Lorenzo Bettini <bettini@dsi.unifi.it> wrote:\n> Sitaram Chamarty wrote:\n>>\n>> Hi Lorenzo,\n>>\n>> On Sun, Nov 15, 2009 at 5:07 AM, Lorenzo Bettini <bettini@dsi.unifi.it>\n>> wrote:\n>>\n>>>                url = git://...\n>>\n>>> isn't this enough to be able to push the experiments branch?\n>>\n>> not normally.\n>>\n>> The \"git://\" protocol is a read-only protocol by default.   Since it is\n>> completely unauthenticated, enabling push via git:// is not a good idea in\n>> general.\n>\n> so probably I managed to push origin master anyway because gitorious asked\n> me for my ssh passphrase?\n\nAs far as I know you could not have pushed anything when the url is\ngit:// (at least by default.  Push over git:// can be enabled but is\nhighly inadvisable and I have not seen anyone enable it nor any good\nreason to)\n\n> Thus, if I had\n>\n> [remote \"origin\"]\n>            fetch = +refs/heads/*:refs/remotes/origin/*\n>            url = git@...\n> [branch \"master\"]\n>            remote = origin\n>            merge = refs/heads/master\n> [branch \"experiments\"]\n>            remote = origin\n>            merge = refs/heads/experiments\n>\n> instead of\n>\n> [remote \"origin\"]\n>            fetch = +refs/heads/*:refs/remotes/origin/*\n>            url = git://...\n> [branch \"master\"]\n>            remote = origin\n>            merge = refs/heads/master\n> [branch \"experiments\"]\n>            remote = origin\n>            merge = refs/heads/experiments\n>\n> I would have been able to push also to branch experiments?   Without having\n> to add\n>\n> [remote \"experiments\"]\n>            url = git@...\n>            fetch = +refs/heads/experiments:refs/remotes/experiments/experiments\n>\n> ?\n\n(by the way: do you mean refs/remotes/origin/experiments in that last\nline above?)\n\nAnyway to answer your question, I do not see the refspec line as the issue\nhere, but the URL for the repo, which determines how you access it.\n\nregards,\n\nsitaram\n"},{"id":"127682","messageId":"hdrr1e$oub$1@ger.gmane.org","threadId":"21621","inReplyTo":"2e24e5b90911150304i1472ed13k6c60611ef2e9ba19@mail.gmail.com","subject":"Re: pushing remote branches","fromName":"Lorenzo Bettini","fromEmail":"bettini@dsi.unifi.it","sentAt":"2009-11-16T15:27:32Z","receivedAt":"2009-11-16T15:27:32Z","isPatch":false,"sender":{"key":"bettini@dsi.unifi.it","avatar":"https://gravatar.com/avatar/05ca421365c7ab6093049d1b9fe36e4375a5ea67adf8e09d7c993ff754e84b7f?d=mp&s=160"},"body":"Sitaram Chamarty wrote:\n> \n>> Thus, if I had\n>>\n>> [remote \"origin\"]\n>>            fetch = +refs/heads/*:refs/remotes/origin/*\n>>            url = git@...\n>> [branch \"master\"]\n>>            remote = origin\n>>            merge = refs/heads/master\n>> [branch \"experiments\"]\n>>            remote = origin\n>>            merge = refs/heads/experiments\n>>\n>> instead of\n>>\n>> [remote \"origin\"]\n>>            fetch = +refs/heads/*:refs/remotes/origin/*\n>>            url = git://...\n>> [branch \"master\"]\n>>            remote = origin\n>>            merge = refs/heads/master\n>> [branch \"experiments\"]\n>>            remote = origin\n>>            merge = refs/heads/experiments\n>>\n>> I would have been able to push also to branch experiments?   Without having\n>> to add\n>>\n>> [remote \"experiments\"]\n>>            url = git@...\n>>            fetch = +refs/heads/experiments:refs/remotes/experiments/experiments\n>>\n>> ?\n> \n> (by the way: do you mean refs/remotes/origin/experiments in that last\n> line above?)\n> \n\nno, it's just like I wrote it...\n\nyou mean in\n\n[remote \"experiments\"]\n         url = git@gitorious.org...\n         fetch = \n+refs/heads/experiments:refs/remotes/experiments/experiments\n\nor in\n\n[branch \"experiments\"]\n         remote = origin\n         merge = refs/heads/experiments\n\n\n?\n\n> Anyway to answer your question, I do not see the refspec line as the issue\n> here, but the URL for the repo, which determines how you access it.\n\nso this would have been enough:\n\n >> [remote \"origin\"]\n >>            fetch = +refs/heads/*:refs/remotes/origin/*\n >>            url = git://...\n >> [branch \"master\"]\n >>            remote = origin\n >>            merge = refs/heads/master\n >> [branch \"experiments\"]\n >>            remote = origin\n >>            merge = refs/heads/experiments\n\n?\n\nthanks\n\tLorenzo\n\n-- \nLorenzo Bettini, PhD in Computer Science, DI, Univ. Torino\nHOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com\nBLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com\n"},{"id":"127696","messageId":"7vlji6p75y.fsf@alter.siamese.dyndns.org","threadId":"21621","inReplyTo":"hdrr1e$oub$1@ger.gmane.org","subject":"Re: pushing remote branches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-16T20:05:13Z","receivedAt":"2009-11-16T20:05:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lorenzo Bettini <bettini@dsi.unifi.it> writes:\n\n>> Anyway to answer your question, I do not see the refspec line as the issue\n>> here, but the URL for the repo, which determines how you access it.\n>\n> so this would have been enough:\n>\n>>> [remote \"origin\"]\n>>>            fetch = +refs/heads/*:refs/remotes/origin/*\n>>>            url = git://...\n>>> [branch \"master\"]\n>>>            remote = origin\n>>>            merge = refs/heads/master\n>>> [branch \"experiments\"]\n>>>            remote = origin\n>>>            merge = refs/heads/experiments\n\nBecause \"git://\" is almost always read-only, you wouldn't be able to push\nback to the origin with that configuration.  If you are only following the\nproject that is perfectly fine.\n\nOtherwise, either use \"git@...\" in remote.origin.url to use git-over-ssh\nin both directions, or you can use pushurl if you have recent enough\nversion of git, like:\n\n    [remote \"origin\"]\n        fetch = +refs/heads/*:refs/remotes/origin/*\n        url = git://...\n        pushurl = git@...\n\nWhen you primed your repository with \"git clone git://...\", it would be\nnice if \"clone\" added a \"corresponding\" pushurl for you.  But ... part of\nthe two lines are often different, depending on how hosting site is\norganized, so unfortunately \"clone\" cannot do so.\n"}]}