git clone from local to remote

前端 未结 6 2054
慢半拍i
慢半拍i 2020-12-23 12:03

We\'re in the process of migrating from Mercurial to Git for our workflow and I have two minor issues.

First, is it possible to \"clone\" a local repository directly

6条回答
  •  执笔经年
    2020-12-23 12:36

    This answer is good but I was not able to get it to work for me. The following code from this link did http://thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/. On the remote run

    mkdir my_project.git
    cd my_project.git
    git init --bare
    git-update-server-info # If planning to serve via HTTP
    

    Locally on an existing repository that already has at least one commit run

    git remote add origin git@example.com:my_project.git
    git push -u origin master
    

    I hope this helps anyone that had problems with the other answer.

提交回复
热议问题