{"thread":{"id":"42820","subject":"git push doesn't update the status with multiple remotes","startedAt":"2016-07-11T16:54:55Z","lastAt":"2016-07-12T08:45:50Z","messageCount":3,"participants":["Garoe","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"291175","messageId":"5783CF57.1010105@gmail.com","threadId":"42820","inReplyTo":null,"subject":"git push doesn't update the status with multiple remotes","fromName":"Garoe","fromEmail":"garoedp@gmail.com","sentAt":"2016-07-11T16:54:47Z","receivedAt":"2016-07-11T16:54:55Z","isPatch":false,"sender":{"key":"garoedp@gmail.com","avatar":null},"body":"Hello,\n\nI'm using git 1.9.1 in Ubuntu 14.04.\n\nI have a repository on github, a clone on my desktop and bare repo on a \nprivate server, in my desktop the remotes looks like this\n\nall\tgit@github.com:user/repo.git (fetch)\nall\tgit@github.com:user/repo.git (push)\nall\tuser@server.com:user/repo.git (push)\nserver\tuser@server.com:user/repo.git (fetch)\nserver\tuser@server.com:user/repo.git (push)\norigin\tgit@github.com:user/repo.git (fetch)\norigin\tgit@github.com:user/repo.git (push)\n\nIf I commit to master in my desktop and run 'git push all master', the \ngithub and the server repos are correctly updated, but if I run 'git \nstatus' the message says:\n\nYour branch is ahead of 'origin/master' by 1 commit.\n   (use \"git push\" to publish your local commits)\n\nThe message won't update unless I run git fetch or git push origin master.\nI'd expect the git status to give me a updated status message after \ncalling 'git push all master'.\n\nBest regards,\nGaroe\n\n\n"},{"id":"291239","messageId":"84c1ac72-cbe7-7490-2c61-9302703cb28b@kdbg.org","threadId":"42820","inReplyTo":"5783CF57.1010105@gmail.com","subject":"Re: git push doesn't update the status with multiple remotes","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-07-12T05:26:15Z","receivedAt":"2016-07-12T05:26:23Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 11.07.2016 um 18:54 schrieb Garoe:\n> I have a repository on github, a clone on my desktop and bare repo on a\n> private server, in my desktop the remotes looks like this\n>\n> all    git@github.com:user/repo.git (fetch)\n> all    git@github.com:user/repo.git (push)\n> all    user@server.com:user/repo.git (push)\n> server    user@server.com:user/repo.git (fetch)\n> server    user@server.com:user/repo.git (push)\n> origin    git@github.com:user/repo.git (fetch)\n> origin    git@github.com:user/repo.git (push)\n>\n> If I commit to master in my desktop and run 'git push all master', the\n> github and the server repos are correctly updated, but if I run 'git\n> status' the message says:\n>\n> Your branch is ahead of 'origin/master' by 1 commit.\n>   (use \"git push\" to publish your local commits)\n\nBut \"all\" and \"origin\" are different remotes. Just because you use the \nsame URL does not make them the same remote repository from the view of \nyour local repository.\n\n(Additionally, \"all\" is not a special name, just in case you had \nexpected that.)\n\n> The message won't update unless I run git fetch or git push origin master.\n\nYes, that's how it is supposed to work.\n\nI think there is some way to configure that a single push command pushes \nto several remote repositories, but I can't find it right now...\n\n-- Hannes\n\n"},{"id":"291244","messageId":"5784AE0B.2040709@gmail.com","threadId":"42820","inReplyTo":"84c1ac72-cbe7-7490-2c61-9302703cb28b@kdbg.org","subject":"Re: git push doesn't update the status with multiple remotes","fromName":"Garoe","fromEmail":"garoedp@gmail.com","sentAt":"2016-07-12T08:44:59Z","receivedAt":"2016-07-12T08:45:50Z","isPatch":false,"sender":{"key":"garoedp@gmail.com","avatar":null},"body":"Thanks for the quick reply.\n\nOn 12/07/16 06:26, Johannes Sixt wrote:\n> Am 11.07.2016 um 18:54 schrieb Garoe:\n>> I have a repository on github, a clone on my desktop and bare repo on a\n>> private server, in my desktop the remotes looks like this\n>>\n>> all    git@github.com:user/repo.git (fetch)\n>> all    git@github.com:user/repo.git (push)\n>> all    user@server.com:user/repo.git (push)\n>> server    user@server.com:user/repo.git (fetch)\n>> server    user@server.com:user/repo.git (push)\n>> origin    git@github.com:user/repo.git (fetch)\n>> origin    git@github.com:user/repo.git (push)\n>>\n>> If I commit to master in my desktop and run 'git push all master', the\n>> github and the server repos are correctly updated, but if I run 'git\n>> status' the message says:\n>>\n>> Your branch is ahead of 'origin/master' by 1 commit.\n>>   (use \"git push\" to publish your local commits)\n>\n> But \"all\" and \"origin\" are different remotes. Just because you use the\n> same URL does not make them the same remote repository from the view of\n> your local repository.\n\nI expected git to be \"intelligent\" enough to detect that if the url are \nthe same, it had already exchanged information with the server by the \npush command, so it would update the message without explicitly pushing \nto origin.\n\n>\n> (Additionally, \"all\" is not a special name, just in case you had\n> expected that.)\n>\n>> The message won't update unless I run git fetch or git push origin\n>> master.\n>\n> Yes, that's how it is supposed to work.\n\n From my point of view the current behaviour is counter-intuitive. \nAnyhow, I understand by your answer that the current behaviour is \ndesired and it won't be changed.\n\n> I think there is some way to configure that a single push command pushes\n> to several remote repositories, but I can't find it right now...\n>\n> -- Hannes\n>\n\nThanks again,\nGaroe\n"}]}