--initial-branch= clone option

27 views
Skip to first unread message

Larry Weisberg

unread,
Oct 25, 2022, 11:13:04 AM10/25/22
to git-tfs-dev
I saw in https://github.com/git-tfs/git-tfs/blob/master/doc/commands/clone.md this option:
      --initial-branch=VALUE Passed to git-init (requires Git >= 2.28.0)
My git (git bash) --version: git version 2.37.1.windows.1 

Running git tfs clone which gives me clone help, does not list this option.  When I tried to use the option as 
--initial-branch=main
when cloning a TFS repository-path called Main, rather than my getting a directory called Main, the directory was called "--initial-branch=main" :-(
And when going into it an running git status, I saw default branch was still called master.

Any idea if this is supposed to be supported?  Also given a command like the following, where should that option be entered? is it in the correct location?
MSYS_NO_PATHCONV=1  git tfs clone http://servertfs401:8080/tfs/defaultcollection "$/XXXX/Main" --initial-branch=main --changeset 8840 --ignore-branches-regex=XXXX.Branches --ignore-regex="(Business Utilities|External Procedures)/"

Thanks,
Larry

Matt Burke

unread,
Nov 7, 2022, 1:26:33 PM11/7/22
to git-t...@googlegroups.com
Hi Larry,

Yes, --initial-branch is still in the code. I don't remember the ins-and-outs of the option parsing library we're using, but I'd recommend moving all the options in front of the positional arguments to see if that fixes it. In your example, that would look like this:

MSYS_NO_PATHCONV=1  git tfs clone --initial-branch=main --changeset 8840 --ignore-branches-regex=XXXX.Branches --ignore-regex="(Business Utilities|External Procedures)/" http://servertfs401:8080/tfs/defaultcollection "$/XXXX/Main"

--
Matt

--
You received this message because you are subscribed to the Google Groups "git-tfs-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to git-tfs-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/git-tfs-dev/ae866180-5d79-435d-aa00-175611244fefn%40googlegroups.com.

Peter Baumann

unread,
Nov 9, 2022, 6:32:36 AM11/9/22
to git-tfs-dev
See also the following issue, perhaps you are experiencing the same?
Short story, the --initial-branch is not yet in a released (pre-build) version of git-tfs

Reply all
Reply to author
Forward
0 new messages