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?

Gary Barrett
  • 1,764
  • 5
  • 21
  • 33

1 Answers1

7

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:

KBeDev
  • 387
  • 5
  • 9