{"thread":{"id":"29439","subject":"{Spam?} push pull not working","startedAt":"2012-01-24T19:00:31Z","lastAt":"2012-01-24T20:28:03Z","messageCount":6,"participants":["Rick Bragg","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"183026","messageId":"1327431631.21582.209.camel@thor","threadId":"29439","inReplyTo":null,"subject":"{Spam?} push pull not working","fromName":"Rick Bragg","fromEmail":"lists@gmnet.net","sentAt":"2012-01-24T19:00:31Z","receivedAt":"2012-01-24T19:00:31Z","isPatch":false,"sender":{"key":"lists@gmnet.net","avatar":null},"body":"Hi,\n\nI cloned a repo from /home/me/repo1 to /home/me/repo2.  Then made\nchanges and a new commit on repo1, then from repo1 did \"git\npush /home/me/repo2 and it says Everything is up-to-date.  How could\nthis be?\n\nThanks\nRick\n"},{"id":"183028","messageId":"20120124194153.GB19534@sigill.intra.peff.net","threadId":"29439","inReplyTo":"1327431631.21582.209.camel@thor","subject":"Re: {Spam?} push pull not working","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-01-24T19:41:54Z","receivedAt":"2012-01-24T19:41:54Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jan 24, 2012 at 02:00:31PM -0500, Rick Bragg wrote:\n\n> I cloned a repo from /home/me/repo1 to /home/me/repo2.  Then made\n> changes and a new commit on repo1, then from repo1 did \"git\n> push /home/me/repo2 and it says Everything is up-to-date.  How could\n> this be?\n\nIt's hard to say, since you didn't show us the exact commands you ran.\n\nOne possible cause is that you made your commit on a detached HEAD, not\non a branch, and therefore pushing branches will have no effect. You can\ncheck this by running \"git status\", which will report either your\ncurrent branch or \"not currently on any branch\".\n\nAnother possible cause is that git is not trying to push the branches\nthat you think it is.\n\nFor example, imagine repo1 has two branches, \"master\" and \"foo\", and the\n\"master\" branch is checked out. When you clone it, the resulting repo2\nwill have remote-tracking branches for both \"master\" and \"foo\", but will\nonly checkout the \"master\" branch. Now imagine you make commits on\n\"foo\" in repo1, and then try to push. Git's default behavior is to push\nonly branches which match (by name) a branch on the destination. So we\nwould attempt to push \"master\" (which is up to date), but not \"foo\".\n\nYou can see which branches are being considered in the push with \"git\npush -vv\". If you want to push all branches, you can use \"git push\n--all\", or read up on refspecs in \"git help push\". If you want to change\ngit-push's default behavior, read up on \"push.default\" in \"git help\nconfig\".\n\n-Peff\n"},{"id":"183031","messageId":"1327435530.21582.211.camel@thor","threadId":"29439","inReplyTo":"20120124194153.GB19534@sigill.intra.peff.net","subject":"{Spam?} Re: push pull not working","fromName":"Rick Bragg","fromEmail":"lists@gmnet.net","sentAt":"2012-01-24T20:05:30Z","receivedAt":"2012-01-24T20:05:30Z","isPatch":false,"sender":{"key":"lists@gmnet.net","avatar":null},"body":"On Tue, 2012-01-24 at 14:41 -0500, Jeff King wrote:\n> On Tue, Jan 24, 2012 at 02:00:31PM -0500, Rick Bragg wrote:\n> \n> > I cloned a repo from /home/me/repo1 to /home/me/repo2.  Then made\n> > changes and a new commit on repo1, then from repo1 did \"git\n> > push /home/me/repo2 and it says Everything is up-to-date.  How could\n> > this be?\n> \n> It's hard to say, since you didn't show us the exact commands you ran.\n> \n> One possible cause is that you made your commit on a detached HEAD, not\n> on a branch, and therefore pushing branches will have no effect. You can\n> check this by running \"git status\", which will report either your\n> current branch or \"not currently on any branch\".\n> \n> Another possible cause is that git is not trying to push the branches\n> that you think it is.\n> \n> For example, imagine repo1 has two branches, \"master\" and \"foo\", and the\n> \"master\" branch is checked out. When you clone it, the resulting repo2\n> will have remote-tracking branches for both \"master\" and \"foo\", but will\n> only checkout the \"master\" branch. Now imagine you make commits on\n> \"foo\" in repo1, and then try to push. Git's default behavior is to push\n> only branches which match (by name) a branch on the destination. So we\n> would attempt to push \"master\" (which is up to date), but not \"foo\".\n> \n> You can see which branches are being considered in the push with \"git\n> push -vv\". If you want to push all branches, you can use \"git push\n> --all\", or read up on refspecs in \"git help push\". If you want to change\n> git-push's default behavior, read up on \"push.default\" in \"git help\n> config\".\n> \n> -Peff\n> \n\nThanks, I went back a few commits and tried again and it works.  I'm not\nsure what it was, I will have allot of reading to do.\n\nThanks again!\nRick\n"},{"id":"183033","messageId":"7vty3k3lmh.fsf@alter.siamese.dyndns.org","threadId":"29439","inReplyTo":"20120124194153.GB19534@sigill.intra.peff.net","subject":"Re: {Spam?} push pull not working","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-01-24T20:12:54Z","receivedAt":"2012-01-24T20:12:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> For example, imagine repo1 has two branches, \"master\" and \"foo\", and the\n> \"master\" branch is checked out. When you clone it, the resulting repo2\n> will have remote-tracking branches for both \"master\" and \"foo\", but will\n> only checkout the \"master\" branch. Now imagine you make commits on\n> \"foo\" in repo1, and then try to push. Git's default behavior is to push\n> only branches which match (by name) a branch on the destination. So we\n> would attempt to push \"master\" (which is up to date), but not \"foo\".\n\nTechnically you are not saying anything incorrect, but the above is not an\nappropriate paragraph to give to a total newbie, I would have to say.\n\nIt does not make it clear that it is insane to push to repo2 with matching\npush (or \"current\" or \"upstream\" for that matter), after cloning from a\nrepository repo1 with a working tree to repo2 with an working tree, and\nmaking changes at the original repo1 repository. Instead, you are giving a\nfalse impression that pushing both \"master\" and \"foo\" explicitly would\nsolve the problem OP is having, which is not true.\n\nIf repo1 and repo2 with working trees want to criss-cross-exchange their\nhistories, both should \"git pull\" from the other, not \"git push\", and if\none side cannot initiate a connection to the other, \"git push\" that goes\nin the other direction should be pushing into remote tracking refs of the\nother in order to emulate a \"git pull\" that goes in the other direction.\n"},{"id":"183035","messageId":"20120124201807.GA20145@sigill.intra.peff.net","threadId":"29439","inReplyTo":"7vty3k3lmh.fsf@alter.siamese.dyndns.org","subject":"Re: {Spam?} push pull not working","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-01-24T20:18:07Z","receivedAt":"2012-01-24T20:18:07Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jan 24, 2012 at 12:12:54PM -0800, Junio C Hamano wrote:\n\n> > For example, imagine repo1 has two branches, \"master\" and \"foo\", and the\n> > \"master\" branch is checked out. When you clone it, the resulting repo2\n> > will have remote-tracking branches for both \"master\" and \"foo\", but will\n> > only checkout the \"master\" branch. Now imagine you make commits on\n> > \"foo\" in repo1, and then try to push. Git's default behavior is to push\n> > only branches which match (by name) a branch on the destination. So we\n> > would attempt to push \"master\" (which is up to date), but not \"foo\".\n> \n> Technically you are not saying anything incorrect, but the above is not an\n> appropriate paragraph to give to a total newbie, I would have to say.\n> [...]\n\nYeah, I agree with all of this. I was trying not to go into too much\ndetail because we knew so little about the situation (e.g., we don't\neven know if repo2 in the example is bare or not!), but perhaps my\nterseness made things even more confusing.\n\nThis might have been a better example (it exhibits the problem, but is\nnot an example of a terrible thing to be doing):\n\n  1. repo1 has a \"master\" branch\n\n  2. clone repo1 with \"git clone --bare repo1 repo2\". Repo2 now has a\n     master branch.\n\n  3. create a new \"foo\" branch in repo and commit on it\n\n  4. \"git push ../repo2\" from repo1. This is a sane thing to be doing,\n     but will not push the newly-created \"foo\" branch, as some users\n     might expect.\n\n-Peff\n"},{"id":"183037","messageId":"7vliow3kx8.fsf@alter.siamese.dyndns.org","threadId":"29439","inReplyTo":"20120124201807.GA20145@sigill.intra.peff.net","subject":"Re: {Spam?} push pull not working","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-01-24T20:28:03Z","receivedAt":"2012-01-24T20:28:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> This might have been a better example (it exhibits the problem, but is\n> not an example of a terrible thing to be doing):\n>\n>   1. repo1 has a \"master\" branch\n>\n>   2. clone repo1 with \"git clone --bare repo1 repo2\". Repo2 now has a\n>      master branch.\n>\n>   3. create a new \"foo\" branch in repo and commit on it\n>\n>   4. \"git push ../repo2\" from repo1. This is a sane thing to be doing,\n>      but will not push the newly-created \"foo\" branch, as some users\n>      might expect.\n\nYeah, that is pretty much the standard thing people would do, at least\nbefore GitHub era ;-), to start a project in repo1, and then to publish\nfor others to fetch at repo2.\n\nThanks for clarification.\n\nP.S. Did you have chance to take a look at the \"grep\" thing? I thought\n\"grep --textconv\" would make sense, but I may be missing some large\npitfalls.\n"}]}