English 中文(简体)
吉恩: “你似乎掩饰了一个空洞存放处”
原标题:Git clone: "You appear to have cloned an empty repository"

一些同事和我一直在从事一个存放在私人吉特存放处的项目。 从历史上看,没有任何问题,但最近我试图掩盖并处理下列问题:

Cloning into  project ...
warning: You appear to have cloned an empty repository.
Checking connectivity... done.

缩略语 规定:

fatal: your current branch  master  does not have any commits yet

这是正确的,我的同事于6月大力推行了无先发制人的变化(尽管现在该分支在<条码>上显示有色人/条码<>。 在冲入吉苏库后,那里有大量的档案和夹。

因此,我的问题:

  1. How could this have happened?
  2. How can we recover the repository? It seems the stuff is on the remote repo, but for some reason, it isn t aware that it s there.
问题回答

You have cloned the correct repository. I think they have not pushed into the master branch. The other branches will be there like origin/development-example. You need to make a local branch which can track the remote branches and then you can get the latest code. This is how you can track remote branches:

git branch --track dev-example origin/dev-example
git checkout dev-example

当你用克隆技术生产一个新的、没有承诺的存放处时,就会出现这种情况。

正如它所说的那样,这只是警告。 如果在存放处没有任何东西,你可以接手,增加档案,承诺并击退。

如果它不是空洞的,就与你联系的人/行政当局联系。

在我的案件中,当我试图从另一个机器上穿透时,这无疑是错误的: 页: 1 奇怪的是,我没有发现任何错误,但“你似乎掩饰了一个空洞存放处”。

一位我的同事刚才也有一个类似的问题。 坦率地说, 我不知道为什么会发生这种事情,因为只有简单的家用克隆技术在我们团队的其余部分工作。 但是,归根结底,这里的解决办法有助于——而不是<条码>条码。 我们必须做到基本相同,但人工:

  1. Create an empty folder for your project, say project/
  2. In project/, run git init
  3. Add the remote: git remote add origin https://github.com/yourAccount/yourrepo.git
  4. Pull from the remote: git pull origin master

I updated git client version, it worked. Maybe worth a try.

我在迁移到一个新的Gitelab服务器后遇到了同样的问题。

它是在采取以下步骤之后确定的。

例如,如果Gite URL项目为http://gitlab.abc.work/neptune- open/neptune-developer-guide.git

  1. Clone the repo
    git clone [email protected]/neptune-open/neptune-developer-guide.git
    
  2. Edit the local Git config (for example, with vi):
    vi neptune-developer-guide/.git/config
    
    Then change the "origin" url to http format:
    [remote "origin"]
        url = http://gitlab.abc.work/neptune-open/neptune-developer-guide.git
    
  3. Modify any file in the project
  4. Commit the modifications to the file
    cd neptune-developer-guide && git add . && git commit -m "fix git clone issue"
    
  5. Push it
    git push origin master
    

我陷入了同一个问题,因为这是一个种族问题:

gh repo create xxx --template template-name
gh repo clone xxx

这导致用克隆技术复制空储存。

通过增加拖延(我有15秒钟,但我相信,工作间隔会小得多)

gh repo create xxx --template template-name
sleep 15
gh repo clone xxx




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签