获取.git目录而不克隆存储库 [英] Get .git directory without cloning down a repository

查看:95
本文介绍了获取.git目录而不克隆存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的git repo,需要一段时间才能克隆.但是,我不需要完整的存储库,而是想检查生成的.git存储库.有没有一种方法可以获取此存储库的.git文件夹而无需将其克隆下来?

I have a very large git repo which takes a while to clone. However I don't need the full repo, I instead want to examine the .git repo that gets generated. Is there a way I can get the .git folder for this repo without actually cloning it down?

推荐答案

我认为您的意思是裸露的克隆

I think you mean a bare clone

git clone --bare

它将创建不带文件的克隆,并且文件夹的根目录将包含.git文件夹的内容.

It will create the clone without files and the root of the folder will have the contents of the .git folder.

请参见文档

这篇关于获取.git目录而不克隆存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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