the git clone is empty? why this happens

不羁岁月 提交于 2019-12-02 23:54:37

This particular git repository seems to not have any contents on its master branch, which is the branch git checks out by default. It does however have another branch:

% git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/android-msm-2.6.35
  remotes/origin/master

So if you check out this branch:

% git checkout android-msm-2.6.35
Checking out files: 100% (33866/33866), done.
Branch android-msm-2.6.35 set up to track remote branch android-msm-2.6.35 from origin.
Switched to a new branch 'android-msm-2.6.35'

then there's also content in the working tree.

After your first clone, if you have directories that are submodules of the parent repo, you need to initialize them with:

git submodule update --init

Using git submodule update --init --recursive will also be needed if there are submodules inside submodules.

It seems that repository was cloned. Now you have to checkout something. What happens if you issue:

git branch

Also, what happened on my system just now (windows 7). The automatic initialization (git init) did not take place during the

git clone URL

Operation. Also got the same succesful clone msg.

After I did a 'manual'

git init

The clone operation resulted in a dir with contents. After I repeated it.

So, just try a git init if a dir is empty after a git clone (and the master branch is not empty). Then repeat the clone.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!