0

I am working with two repos (repo_a and repo_b) which are two forks of the same project. They are both very large in terms of files and history. I need to use a small set of branches from each of them, so I would ideally like to have a partial clone which references both as remotes.

What I did was making a partial clone of repo_a then adding the remote for repo_b:

git clone -b some_branch --filter=blob:none https://.../repo_a.git
cd ./repo_a
git remote add repo_b https://.../repo_b.git

The git config shows the following lines under the [remote "origin"] section as expected, indicating a blobless clone:

    promisor = true
    partialclonefilter = blob:none

but not under the [remote "repo_b"] section. Does it mean that only fetches from origin/repo_a will be blobless, while fetches from repo_b will fetch blobs? Should I add those two lines under [remote "repo_b"] or is there a better way to go about it?

2
  • 1
    Editing the config file is fine. Just add the two lines. Commented Nov 20, 2024 at 13:40
  • 1
    BTW, to reduce the number of commits fetch, restrict the fetch lines to the branches that your are interested in, for example, fetch = +refs/heads/main:refs/remotes/origin/main will only ever fetch branch main (unless you are explicit in the fetch or pull command). You can have multiple fetch lines. Commented Nov 20, 2024 at 13:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.