简体   繁体   English

在git-tf中使用git sparse checkout

[英]Using git sparse checkout with git-tf

I'm working with a large TFS collection (around 5GB) and I'm looking for a way to reduce the size of it on my local machine. 我正在使用大型TFS集合(大约5GB),并且正在寻找一种减小本地计算机上文件大小的方法。 If I were using TFS as a client I would cloak the directories I don't need. 如果我将TFS用作客户端,则将隐藏不需要的目录。 But I' using git and connecting via git-tf. 但是我使用git并通过git-tf连接。

I found this article on using sparse checkout: http://jasonkarns.com/blog/subdirectory-checkouts-with-git-sparse-checkout/ and I've seen mentions around the web that git-tf handles it fine. 我发现了有关使用稀疏签出的文章: http : //jasonkarns.com/blog/subdirectory-checkouts-with-git-sparse-checkout/,并且我在网上看到git-tf可以很好地处理它的提法。 However, I'm not clear on how the two are supposed to work together. 但是,我不清楚两者应该如何协同工作。

For example, git-tf doesn't allow me to setup a bare repo and then configure it with "add remote" so I have to download the entire TFS collection when I setup. 例如,git-tf不允许我设置裸仓库,然后使用“ add remote”对其进行配置,因此在设置时必须下载整个TFS集合。 So half-way down the article it talks about turning on sparse checkout on an existing repository. 因此,在本文的中途,它讨论了在现有存储库上启用稀疏签出的问题。 But after following the directions there is no change to my working directory. 但是按照指示进行操作后,我的工作目录没有任何更改。 I tried deleting the directories I excluded, but then git sees the unstaged changes. 我尝试删除排除的目录,但是git看到了未暂存的更改。

How am I supposed to setup sparse checkout w/ git-tf? 我应该如何设置带有git-tf的稀疏签出?

It's been awhile since this question has been posed, but with git-tf, you now can specify the --bare option with git-tf clone. 提出这个问题已经有一段时间了,但是使用git-tf,您现在可以使用git-tf clone指定--bare选项。 This will create the contents of the .git subdirectory in the current directory so be sure to specify a .git directory in the clone command. 这将在当前目录中创建.git子目录的内容,因此请确保在clone命令中指定.git目录。

From there, you should be able to use the same options within git detailed in the articles you linked to in your question. 从那里开始,您应该可以在问题中链接到的文章中详细使用git中的相同选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM