【发布时间】:2021-07-11 09:44:51
【问题描述】:
我已经使用 git-tfs 将 TFS 存储库克隆到我的本地计算机中。我使用了以下命令:
git tfs clone <server URL> <repository path> <local directory> --branches=auto
当我在源代码树中打开存储库时,我只能看到直接提交到主分支的提交。 git log 显示提交历史,但是,源树仅显示主分支提交。我需要查看所有分支中提交的完整历史记录,但我没有成功。
编辑:
如果我尝试使用 --branches=all,我也会收到一些错误。
2021-04-19 10:46:19.9024 [Debug] git command time: [00:00:00.0468850] init
2021-04-19 10:46:19.9493 [Debug] No .gitignore file specified to commit...
2021-04-19 10:46:19.9493 [Debug] No .gitignore file specified to use...
2021-04-19 10:46:22.9008 [Debug] Looking for all branches...
2021-04-19 10:46:24.5489 [Debug] GitTfs.Core.GitTfsException: error: cloning the whole repository or too high in the repository path doesn't permit to manage branches!
=> If you want to manage branches with git-tfs, clone one of this branch instead :
PS:if your branch is not listed here, perhaps you should convert the containing folder to a branch in TFS.
at GitTfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList`1 args) in C:\gittfs\src\GitTfs\Util\GitTfsCommandRunner.cs:line 36
at GitTfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in C:\gittfs\src\GitTfs\GitTfs.cs:line 83
at GitTfs.GitTfs.Run(IList`1 args) in C:\gittfs\src\GitTfs\GitTfs.cs:line 48
at GitTfs.Program.Main(String[] args) in C:\gittfs\src\GitTfs\Program.cs:line 28
分支结构类似如下:
$/App/App.root/App [*]
|
+- $/App/App.root/backend/csv/Version-1.0
| |
| +- $/App/App.root/backend/csv/Version-1.1
| |
| +- $/App/App.root/backend/csv/Version-1.1/Fixes
| |
|
当我在$/App 中使用git tfs 时,它只会拉取主分支中的提交。我看不到包含所有分支及其提交的完整树。
【问题讨论】:
-
你没有提供足够的信息来说明你想要实现什么,你的分支结构是什么等等。尝试github.com/git-tfs/git-tfs/blob/master/doc/commands/…找到一个分支来克隆。
-
@Philippe 请查看编辑。
-
查看我编辑的答案。