试图在git中克隆存储库,出现错误 [英] Trying to clone a repository in git, getting a error

查看:288
本文介绍了试图在git中克隆存储库,出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个盒子,一个是我的本地机器,另一个是我的开发服务器。现在我正在测试此使用Git部署应用程序的方法



我设置了本地存储库,添加了随后提交的文件。我在Windows 7&我的服务器是Windows Server 2008.



服务器映射为W:\ Drive与我的'裸'存储库和我的目标'mock'生产文件夹作为子文件夹。
- 我可以对每个人都很好,没有连接问题。



以下是我设置所有内容的步骤: 本地目录git remote add origin w:\ gitCentral

  • 本地目录git push origin master


  • 键入C :,然后键入CD testDeployment


  • 现在我在我的测试文件夹中。



    一种。我做git克隆w:/ gitCentral





  • 克隆到gitCentral ... done。

    error:refs / remotes / origin / master does

    不能指向一个有效的对象!错误:


    尝试写入ref refs / heads / master

    with nonexistant object 559e2165845


    06e14ebef1121059e9461a86dd4f8致命:


    无法更新ref'HEAD'。



    解决方案

    试着做以下(从本地文件夹开始,考虑它是一个git仓库,并提交了当前的HEAD):

      git remote add origin w:/ gitCentral 
    git fetch origin
    git push origin master
    cd C:/ testDeployment
    git clone w:/ gitCentral


    I have two boxes, one is my local machine and the other is my dev server. Right now I'm testing this method of deploying apps using Git

    I setup my local repository, added the files then committed. I am on Windows 7 & my server is Windows Server 2008.

    The server is mapped as the W:\ Drive with my 'bare' repository and my target 'mock' production folder as child folders. -- I can get to each just fine, no connection problems.

    Here's what I did to setup everything:

    1. Local dir git remote add origin w:\gitCentral

    2. Local dir git push origin master

    3. Type C:, then type CD testDeployment

    4. Now I'm in my test folder.

      A. I do git clone w:/gitCentral

    Cloning into gitCentral... done.
    error: refs/remotes/origin/master does
    not point to a valid object! error:
    Trying to write ref refs/heads/master
    with nonexistant object 559e2165845
    06e14ebef1121059e9461a86dd4f8 fatal:
    Cannot update the ref 'HEAD'.

    解决方案

    try to do the following (starting from your local folder, considering it is a git repo and has commits in current HEAD):

    git remote add origin w:/gitCentral
    git fetch origin
    git push origin master
    cd C:/testDeployment
    git clone w:/gitCentral
    

    这篇关于试图在git中克隆存储库,出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆