git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to make "git push/pull" work in non-clone repo?

From
HSHong-Ming Su <halleyinvent@gmail.com>
Date
Nov 3, 2011, 16:10 UTC
Message-ID
<CANiMyiF=C_uBXf3kV8ix=CY9Mi=cxHU-J3dn5UyJ87gu3Sm0dg@mail.gmail.com>
In-Reply-To
<F802D297-95A0-4B1E-894D-9681E0EEF3AD@jetbrains.com>
Thank for your hints. I get "git push" work. The "git pull" need argument.

/d/workspace/git $ ls depot work1 work2

/d/workspace/git $ git clone --bare work1 depot Cloning into bare repository depot... done.

/d/workspace/git/work1 (master) $ git push fatal: No destination configured to push to.

/d/workspace/git/work1 (master) $ git pull fatal: No remote repository specified. Please, specify either a URL or a remote name from which new revisions should be fetched.

/d/workspace/git/work1 (master) $ git remote add origin ../depot

/d/workspace/git/work1 (master) $ git push Everything up-to-date

/d/workspace/git/work1 (master)
$ git pull
From ../depot
 * [new branch]      master     -> origin/master
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

If you often merge with the same branch, you may want to use something like the following in your configuration file:

    [branch "master"]
    remote = <nickname>
    merge = <remote-ref>
    [remote "<nickname>"]
    url = <url>
    fetch = <refspec>

/d/workspace/git/work1 (master) $ git pull origin master:master Already up-to-date. 2011/11/4 Kirill Likhodedov <Kirill.Likhodedov@jetbrains.com>:

Show 27 quoted lines
>
>
> 03.11.2011, в 17:59, Hong-Ming Su:
>
>> I create a repo X with git init. After several commit in X, I clone a
>> bare repo Y from X.
>> I try to continue work in X, and push to/pull from Y. The command git
>> push and git pull fails. I see the error message but I do not know
>> which git command can fix that problem.
>> Then I clone Z from Y. git push/pull works in Z.
>> How to make "git push/pull" the same in X as in Z?
>>
>
>
> By cloning Y from X you made X to be a parent of Y while you need vice versa.
> To fix this add Y as a remote to X and set up tracking for you master branch.
>
> By the way, in such cases you'd better write commands you've executed, and the error report you've got.
> " I see the error message but I do not know which git command can fix that problem" - this is zero of useful information.
>
> ----------------------------------
> Kirill Likhodedov
> JetBrains, Inc
> http://www.jetbrains.com
> "Develop with pleasure!"
>
>
Previous: Kirill LikhodedovNext: Andreas Schwab
Message 4 of 6 in “How to make "git push/pull" work in non-clone repo?”
  1. Hong-Ming SuNov 3, 2011
  2. Frans KlaverNov 3, 2011
  3. Kirill LikhodedovNov 3, 2011
  4. Hong-Ming SuNov 3, 2011
  5. Andreas SchwabNov 3, 2011
  6. Hong-Ming SuNov 4, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.