{"thread":{"id":"28833","subject":"How to make \"git push/pull\" work in non-clone repo?","startedAt":"2011-11-03T14:59:49Z","lastAt":"2011-11-04T03:33:04Z","messageCount":6,"participants":["Hong-Ming Su","Frans Klaver","Kirill Likhodedov","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"178771","messageId":"CANiMyiFfiLnK8-q7vTZ9VAtkW8ip2NQfpR4iaU2oSnnonVDuUA@mail.gmail.com","threadId":"28833","inReplyTo":null,"subject":"How to make \"git push/pull\" work in non-clone repo?","fromName":"Hong-Ming Su","fromEmail":"halleyinvent@gmail.com","sentAt":"2011-11-03T14:59:49Z","receivedAt":"2011-11-03T14:59:49Z","isPatch":false,"sender":{"key":"halleyinvent@gmail.com","avatar":null},"body":"Hi,\n\nI create a repo X with git init. After several commit in X, I clone a\nbare repo Y from X.\nI try to continue work in X, and push to/pull from Y. The command git\npush and git pull fails. I see the error message but I do not know\nwhich git command can fix that problem.\nThen I clone Z from Y. git push/pull works in Z.\nHow to make \"git push/pull\" the same in X as in Z?\n\nThanks,\nHong-Ming\n"},{"id":"178772","messageId":"CAH6sp9M1PxxHqKC-M0rtsEbdsmY1vBb_m_6G=266QkVtTDE=EQ@mail.gmail.com","threadId":"28833","inReplyTo":"CANiMyiFfiLnK8-q7vTZ9VAtkW8ip2NQfpR4iaU2oSnnonVDuUA@mail.gmail.com","subject":"Re: How to make \"git push/pull\" work in non-clone repo?","fromName":"Frans Klaver","fromEmail":"fransklaver@gmail.com","sentAt":"2011-11-03T15:07:36Z","receivedAt":"2011-11-03T15:07:36Z","isPatch":false,"sender":{"key":"fransklaver@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1876483?v=4"},"body":"Hi,\n\nOn Thu, Nov 3, 2011 at 3:59 PM, Hong-Ming Su <halleyinvent@gmail.com> wrote:\n\n> I create a repo X with git init. After several commit in X, I clone a\n> bare repo Y from X.\n> I try to continue work in X, and push to/pull from Y. The command git\n> push and git pull fails. I see the error message but I do not know\n> which git command can fix that problem.\n\nCare to tell us which commands you use and which errors you get? It\nwill give clues about how to help.\n\n\n> Then I clone Z from Y. git push/pull works in Z.\n> How to make \"git push/pull\" the same in X as in Z?\n\nSame here.\n\nCheers,\nFrans\n"},{"id":"178773","messageId":"F802D297-95A0-4B1E-894D-9681E0EEF3AD@jetbrains.com","threadId":"28833","inReplyTo":"CANiMyiFfiLnK8-q7vTZ9VAtkW8ip2NQfpR4iaU2oSnnonVDuUA@mail.gmail.com","subject":"Re: How to make \"git push/pull\" work in non-clone repo?","fromName":"Kirill Likhodedov","fromEmail":"kirill.likhodedov@jetbrains.com","sentAt":"2011-11-03T16:09:20Z","receivedAt":"2011-11-03T16:09:20Z","isPatch":false,"sender":{"key":"kirill.likhodedov@jetbrains.com","avatar":"https://gravatar.com/avatar/9fd55d2a110e8e96deb3ed7b503d7f3b9b5b1ed5ca9ef6683c15525b11b94e63?d=mp&s=160"},"body":"\n\n03.11.2011, в 17:59, Hong-Ming Su:\n\n> I create a repo X with git init. After several commit in X, I clone a\n> bare repo Y from X.\n> I try to continue work in X, and push to/pull from Y. The command git\n> push and git pull fails. I see the error message but I do not know\n> which git command can fix that problem.\n> Then I clone Z from Y. git push/pull works in Z.\n> How to make \"git push/pull\" the same in X as in Z?\n> \n\n\nBy cloning Y from X you made X to be a parent of Y while you need vice versa.\nTo fix this add Y as a remote to X and set up tracking for you master branch.\n\nBy the way, in such cases you'd better write commands you've executed, and the error report you've got.\n\" I see the error message but I do not know which git command can fix that problem\" - this is zero of useful information.\n\n----------------------------------\nKirill Likhodedov\nJetBrains, Inc\nhttp://www.jetbrains.com\n\"Develop with pleasure!\"\n"},{"id":"178778","messageId":"CANiMyiF=C_uBXf3kV8ix=CY9Mi=cxHU-J3dn5UyJ87gu3Sm0dg@mail.gmail.com","threadId":"28833","inReplyTo":"F802D297-95A0-4B1E-894D-9681E0EEF3AD@jetbrains.com","subject":"Re: How to make \"git push/pull\" work in non-clone repo?","fromName":"Hong-Ming Su","fromEmail":"halleyinvent@gmail.com","sentAt":"2011-11-03T16:10:27Z","receivedAt":"2011-11-03T16:10:27Z","isPatch":false,"sender":{"key":"halleyinvent@gmail.com","avatar":null},"body":"Thank for your hints. I get \"git push\" work. The \"git pull\" need argument.\n\n/d/workspace/git\n$ ls\ndepot  work1  work2\n\n/d/workspace/git\n$ git clone --bare work1 depot\nCloning into bare repository depot...\ndone.\n\n/d/workspace/git/work1 (master)\n$ git push\nfatal: No destination configured to push to.\n\n/d/workspace/git/work1 (master)\n$ git pull\nfatal: No remote repository specified.  Please, specify either a URL or a\nremote name from which new revisions should be fetched.\n\n/d/workspace/git/work1 (master)\n$ git remote add origin ../depot\n\n/d/workspace/git/work1 (master)\n$ git push\nEverything up-to-date\n\n/d/workspace/git/work1 (master)\n$ git pull\nFrom ../depot\n * [new branch]      master     -> origin/master\nYou asked me to pull without telling me which branch you\nwant to merge with, and 'branch.master.merge' in\nyour configuration file does not tell me, either. Please\nspecify which branch you want to use on the command line and\ntry again (e.g. 'git pull <repository> <refspec>').\nSee git-pull(1) for details.\n\nIf you often merge with the same branch, you may want to\nuse something like the following in your configuration file:\n\n    [branch \"master\"]\n    remote = <nickname>\n    merge = <remote-ref>\n\n    [remote \"<nickname>\"]\n    url = <url>\n    fetch = <refspec>\n\n/d/workspace/git/work1 (master)\n$ git pull origin master:master\nAlready up-to-date.\n2011/11/4 Kirill Likhodedov <Kirill.Likhodedov@jetbrains.com>:\n>\n>\n> 03.11.2011, в 17:59, Hong-Ming Su:\n>\n>> I create a repo X with git init. After several commit in X, I clone a\n>> bare repo Y from X.\n>> I try to continue work in X, and push to/pull from Y. The command git\n>> push and git pull fails. I see the error message but I do not know\n>> which git command can fix that problem.\n>> Then I clone Z from Y. git push/pull works in Z.\n>> How to make \"git push/pull\" the same in X as in Z?\n>>\n>\n>\n> By cloning Y from X you made X to be a parent of Y while you need vice versa.\n> To fix this add Y as a remote to X and set up tracking for you master branch.\n>\n> By the way, in such cases you'd better write commands you've executed, and the error report you've got.\n> \" I see the error message but I do not know which git command can fix that problem\" - this is zero of useful information.\n>\n> ----------------------------------\n> Kirill Likhodedov\n> JetBrains, Inc\n> http://www.jetbrains.com\n> \"Develop with pleasure!\"\n>\n>\n"},{"id":"178781","messageId":"m2fwi5nnt8.fsf@igel.home","threadId":"28833","inReplyTo":"CANiMyiF=C_uBXf3kV8ix=CY9Mi=cxHU-J3dn5UyJ87gu3Sm0dg@mail.gmail.com","subject":"Re: How to make \"git push/pull\" work in non-clone repo?","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2011-11-03T17:00:35Z","receivedAt":"2011-11-03T17:00:35Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Hong-Ming Su <halleyinvent@gmail.com> writes:\n\n> /d/workspace/git/work1 (master)\n> $ git remote add origin ../depot\n\n$ git branch --set-upstream master origin/master\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"178809","messageId":"CANiMyiEmDhErgT4PKpbzrCB1=a1kmdta0uDKV+tFAtOQc4tkKA@mail.gmail.com","threadId":"28833","inReplyTo":"m2fwi5nnt8.fsf@igel.home","subject":"Re: How to make \"git push/pull\" work in non-clone repo?","fromName":"Hong-Ming Su","fromEmail":"halleyinvent@gmail.com","sentAt":"2011-11-04T03:33:04Z","receivedAt":"2011-11-04T03:33:04Z","isPatch":false,"sender":{"key":"halleyinvent@gmail.com","avatar":null},"body":"git push -u can set upstream too.\nThanks all!\n\nOn Fri, Nov 4, 2011 at 1:00 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:\n> Hong-Ming Su <halleyinvent@gmail.com> writes:\n>\n>> /d/workspace/git/work1 (master)\n>> $ git remote add origin ../depot\n>\n> $ git branch --set-upstream master origin/master\n>\n> Andreas.\n>\n> --\n> Andreas Schwab, schwab@linux-m68k.org\n> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n> \"And now for something completely different.\"\n>\n"}]}