Specify a default branch
If your project uses a name other than master
as the
default branch name, make sure to specify this name in the
DefaultBranch
field of the repo spec as a full Git ref, such
as refs/heads/main
. Otherwise, if this field is left blank,
the Git Connector assumes that your default branch to clone is
master
. This would mean that you need to:
- add the branch name to the Git command every time you push to, clone, or check out the branch.
- manually check out the branch after you clone it.
To make your work easier, specify a default branch. For example, to make
main
the default branch, you need to add the following line
to the repo spec:
$ DefaultBranch: refs/heads/main
Setting the DefaultBranch
field in the repo spec simplifies
pushing and cloning branches.
In addition, you can push:
-
a single branch by specifying the branch name, which creates a repo with only that branch:
$ git push git@ConnectorHost:graphDepotName/repoName branchName
-
all branches by passing in the
--all
option, which creates a repo with all branches:$ git push git@ConnectorHost:graphDepotName/repoName --all
- all branches and Git tags by passing in the
"*:*"
option, which creates a repo with all branches and Git tags.$ git push git@ConnectorHost:graphDepotName/repoName "*:*"