Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git shallow clone 的一个问题 #2

Open
daqingshu opened this issue Mar 1, 2020 · 0 comments
Open

git shallow clone 的一个问题 #2

daqingshu opened this issue Mar 1, 2020 · 0 comments

Comments

@daqingshu
Copy link

git clone url --depth 1

git bundle create bundlefile --all

传到另外一个电脑,在目录中执行git clone bundlefile
报错 现 git 报告 "fatal: Failed to traverse parents of commit xxxxxxxx"
换一个方法
git bundle unbundle bundlefile
git checkout hash 取出来。然后再用 git switch -c master 固定在主分支上就好了。所有文件都能顺利检出。
运行 git log 会发现出错。是缺少 .git/shallow 文件导致的。
就是说现在复制出来的这个仓库,git 还不知道是 shallow clone 。好在这个文件很简单,就是 HEAD 的 hash 。手工创建一个就好

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant