克隆/只读取git存储库的历史/日志 [英] Cloning / Reading only history /log of a git repository
问题描述
在locale克隆的git仓库中,我可以用
Within a localy cloned git repository i can watch the history with
git log
在一个小工具中,我只需要存储库的历史记录,而不是代码。
有没有克隆版本库的方法(仅限历史版本)?
In a small tool i do only need the history of a repository, not the code. Is there a way to clone a repository without the code (history only) ?
是否有其他方法可以从git存储库获取历史记录。
Is there any other way to get the history only from a git repository.
预先感谢
推荐答案
使用 - 裸
标记:
git clone --bare ...
Git中的裸存储库 只包含版本控制
信息,没有工作文件(没有树),它不包含
特殊的.git子目录。而是直接在主目录中包含
.git子目录的所有内容。
A "bare" repository in Git just contains the version control information and no working files (no tree) and it doesn't contain the special .git sub-directory. Instead, it contains all the contents of the .git sub-directory directly in the main directory itself.
了解更多请参阅文档或此帮助页面关于设置服务器环境使用该选项。
Read more in the documentation on it, or this helpfull page about setting up server environments using the option.
这篇关于克隆/只读取git存储库的历史/日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!