使用git来获取最新版本 [英] Using git to get just the latest revision

查看:111
本文介绍了使用git来获取最新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想跟踪一个使用git的项目。我不想克隆完整的存储库和完整的历史记录,我只想要最新的修订版本,我希望能够从远程项目更新到新版本。



我已经尝试过使用git clone,但是这会创建整个存储库的副本(大文件大小),并且跟踪更改会使磁盘空间更大(100mb的文件现在占用2GB以上)。 b
$ b

我不打算提交补丁,我也不需要历史记录。我只是想要像颠覆版中的最新版本。



这是否可能在git?

解决方案

- depth $ git clone


示例: git clone 克隆,其历史截断为指定的提交数量。 --depth = 1< remote_repo_url>


I want to track a project that uses git. I don't want to clone the full repository and the full history, I just want the latest revision, and I want to be able to update to new revisions from the remote project.

I have tried using git clone, but this creates a copy of the entire repository (huge file size), and tracking changes makes the disk space even bigger (100mb of files now takes up over 2gb).

I'm not going to be submitting patches, and I don't need the history. I just want the latest version like in subversion.

Is this possible in git?

解决方案

Use the --depth option in git clone:

Create a shallow clone with a history truncated to the specified number of commits.

example: git clone --depth=1 <remote_repo_url>

这篇关于使用git来获取最新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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