Git Tfs not showing all branches

791 views Asked by At

I've successfully cloned a large repository as follows (I'm showing just parts of it here):

# git tfs clone --debug --gitignore=/d/Repos/VisualStudio.gitignore --changeset=51731 --branches=all http://server:8080/tfs/MyCollection $/MyProject/Main MyProject

However, I've had a number of errors in the log like

  $/MyProject/Releases/21.1
   =>error:GitTfs.Core.GitTfsException: error: Couldn't fetch parent branch
   at GitTfs.Commands.InitBranch.InitBranchSupportingRename(String tfsBranchPath, String gitBranchNameExpected, IList`1 creationBranchData, IGitTfsRemote defaultRemote, IFetchResult& fetchResult)
   at GitTfs.Commands.InitBranch.InitializeBranches(IGitTfsRemote defaultRemote, List`1 childBranchPaths)

Now I have:

# git tfs branch -r
Found matching Visual Studio version at C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional

TFS branch structure:

 $/MyProject/Main -> default [*]
 |
 +- $/MyProject/Releases/20.1 -> Releases/20.1
 |
 +- $/MyProject/Releases/21.1 -> Releases/21.1
 |  |
 |  +- $/MyProject/Releases/21.1.0 -> Releases/21.1.0

but the repo only has

# git branch
  Releases/21.1.0
* master

# git branch --all
  Releases/21.1.0
* master
  remotes/tfs/Releases/20.1
  remotes/tfs/Releases/21.1
  remotes/tfs/Releases/21.1.0
  remotes/tfs/default

The Releases/20.1 and Releases/21.1 local branches are missing. I've run

# git tfs branch --init $/MyProject/Releases/20.1
warning : There is already a remote for this tfs branch. Branch ignored!

# git tfs branch --init $/MyProject/Releases/21.1
warning : There is already a remote for this tfs branch. Branch ignored!

and

# git tfs fetch -d --all

The latter gave me some additional changesets:

Fetching from TFS remote 'Releases/20.1'...
Commits visited count:1
Commits visited count:1
info: refs/remotes/tfs/Releases/20.1: Getting changesets from 77303 to -1 ...
Setting up a TFS workspace at .git\~w
get [C78089]$/MyProject/Releases/20.1/Source/AP/Source/Business/...
get [C78089]$/MyProject/Releases/20.1/Source/AP/Source/Business/...
get [C78089]$/MyProject/Releases/20.1/Source/AP/Source/Business/...
get [C78089]$/MyProject/Releases/20.1/Source/AP/Source/Business/...
TFS Workspace 'git-tfs-9338d2cd-ca28-4274-8f37-e569ee87b408;HSA' was removed.
C78089 = c813661ce40393a7b01549144dd188d99e4d7d86
GC Countdown: 190
Setting up a TFS workspace at .git\~w
get [C78091]$/MyProject/Releases/20.1/Source/AP/Source/Business/...
get [C78091]$/MyProject/Releases/20.1/Source/AP/Source/Business/...
get [C78091]$/MyProject/Releases/20.1/Source/AP/Source/Business/...
        D       Source/AP/Source/Business/...
TFS Workspace 'git-tfs-ebbe80fc-3c0d-4010-a1b9-fabba018d1e4;HSA' was removed.
C78091 = 940de5f560a08e970ca4e208fcd203d0e0588966
GC Countdown: 189
Cleaning...
Fetching from TFS remote 'Releases/21.1'...
Commits visited count:1
Commits visited count:1
Cleaning...
Fetching from TFS remote 'Releases/21.1.0'...
Commits visited count:1
Commits visited count:1
Cleaning...

And I still don't have the Releases/20.1 and Releases/21.1 branches.

Can I fix this somehow?

Thanks in advance!

0

There are 0 answers