使用浅克隆的Git Pull远程分支

时间:2015-11-24 06:13:06

标签: git version-control shallow-clone

我完成了git shallow clone。由于我工作的一个git项目大约超过2Gb,我不必拉每个分支和旧数据。

我几乎只克隆了master分支,然后更新了git config以从远程拉出我的分支,即使它们是在不同的机器上创建的

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    url = https://repo.com/_git/Project
    fetch = +refs/heads/users/abc/*:refs/remotes/origin/users/abc/*  
    //I changed above one to pull all my branches
[branch "master"]
    remote = origin
    merge = refs/heads/master

很酷的是,现在我将能够将我的分支与主人分开,这对于99%非常好。有时我想明确地提取另一个用户分支users/xyz/TestBranch

如何修改git config来拉取它。如果不更新git config以提取所有分支(完整副本),则会抛出error: pathspec 'users/xyz/TestBranch' did not match any file(s) known to git

0 个答案:

没有答案
相关问题