2

I have a TFS git repository which takes a long time to clone. Is there a way to only clone a single branch in Visual Studio?

1 Answer 1

6

If you are using Git CLI, you should use (in a CMD or PowerShell instance or any other terminal-like client of your preference):

git clone -b branch_name --single-branch 'repo_url'

  • branch_name: is the name of your branch.
  • repo_url is the link of your remote repository.

This will import a specific branch from your remote repository.

According to this, you need to know that Visual Studio just read your .git (and other Git dependencies such as gitignore, gitmodules, etc) configuration.

Considerations:

This works only with git 1.7.10 version and above.

References:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.