Tago.GitCloner.Core
6.0.0-preview-20230920-001
See the version list below for details.
dotnet add package Tago.GitCloner.Core --version 6.0.0-preview-20230920-001
NuGet\Install-Package Tago.GitCloner.Core -Version 6.0.0-preview-20230920-001
<PackageReference Include="Tago.GitCloner.Core" Version="6.0.0-preview-20230920-001" />
paket add Tago.GitCloner.Core --version 6.0.0-preview-20230920-001
#r "nuget: Tago.GitCloner.Core, 6.0.0-preview-20230920-001"
// Install Tago.GitCloner.Core as a Cake Addin #addin nuget:?package=Tago.GitCloner.Core&version=6.0.0-preview-20230920-001&prerelease // Install Tago.GitCloner.Core as a Cake Tool #tool nuget:?package=Tago.GitCloner.Core&version=6.0.0-preview-20230920-001&prerelease
Tago Git Cloner will clone the specified template from Git repository to the provided destination folder.
Usage
Additional features and options of the Tago Git Template Cloner include:
git-cloner
: Starts a clone process as a command line.git-cloner --list
: Lists all available templates in the Git repository.
Prerequisites
Before using the Tago Git Template Cloner, ensure that you have the following prerequisites:
- Git installed on your local machine. You can download Git from https://git-scm.com/downloads.
- Git is added to the machine PATH enviroment variable
- Access to an your organization and a Git repository.
- Sufficient permissions to clone git repositories.
Installation
The Tago Git Template Cloner is a command-line tool and can be installed using the following steps:
Open a terminal or command prompt on your local machine.
Run the following command to install the tool dotnet cli (e.g.,
dotnet
):
dotnet tool install -g Tago.GitCloner.Tool --prerelease
Configuration
Global Settings
Create a git-cloner-config.json
under %userprofile%\.git-cloner
folder
Option | Type | Description |
---|---|---|
TargetGitServer | enum | AzureDevops , Bitbucket |
CredetialType | enum | Default - will use with the current running user, Network or Basic |
OnlyTemplatesWithOptionsFile | bool | only templates having template-options.json will be loaded |
DefaultTargetDirectory | string | default output folder for clones |
Sources |
object array | list of git sources to pull templales from |
Source
Option | Type | Description |
---|---|---|
GitServer | enum | AzureDevops , Bitbucket |
CredetialType | enum | Default - will use with the current running user, Network or Basic |
ApiVersion | string | optional: rest api version |
Href | string | repo url |
UserName | string | optional: domain user name |
Password | string | optional: domain password |
Global Settings Exmaple:
{
"Console": {
"CodePage": 65001,
"OptionsColor": "Yellow"
},
"Git": {
"MainBranchName": "main",
"CreateBranches": [ "First", "Second","main" ],
"CheckoutBranch": "Third"
},
"GitBaseUrl": "http://www.myazuerserver.com:8881/tfs/",
"OnlyTemplatesWithOptionsFile": true,
"DefaultTargetDirectory": "C:/TemplateClones/",
"TargetGitServer": "AzureDevops",
"TargetGitApiVersion": "5.0",
"CredetialType": "Network"
"Sources": [
{
"GitServer": "AzureDevops",
"ApiVersion": "5.0",
"Href": "http://www.myazuerserver.com:8881/tfs/TAGO_GIT/Demos",
"UserName": "userName",
"Password": "pwd",
"CredetialType": "Network"
},
{
"GitServer": "Bitbucket",
"Href": "http://www.mybitbucketserver.com:7990/projects/TAGO/repos",
"UserName": "userName",
"Password": "pwd",
"CredetialType": "Basic"
}
]
}
Template Settings
Create a template-options.json
under the root template git path
Option | Type | Description |
---|---|---|
Replaces |
object array | string replacements definition |
Options |
object array | yes/no user options during clone |
PostAction |
object | action to take after success clone |
Template Settings Exmaple:
{
"Constants": {
"PROJ_TYPE": "Tg-MicroService",
"ORIG_TEMPLATE_NAME": "web-api-template"
},
"FolderPath": "%userprofile%/tago/{GIT_PROJECT_NAME}/{PROJ_TYPE}",
"RepoUrl": "",
"RepoNameFormat": "Repo-{PROJECT_NAME}",
"ProjectNameFormat": "Repo.{PROJECT_NAME}",
"Replaces": [
{
"From": "this-template-name",
"To": "{PROJECT_NAME}"
},
{
//"FilePath": "",
"FilePathPattern": "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/appsettings.development.json$",
"From": "\r\n",
"To": "\n"
}
],
"Options": [
{
"Background": true,
"Condition": {
"AnySelected": true,
//"Selected": []
//"NotSelected": []
},
"Name": "Test",
"Actions": {
"Yes": {
"Remove": {
"JsonNodes":[
{
"FilePath": "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/appsettings.json",
"NodePath": "Logging:LogLevel:default"
}
],
"XmlNodes":[
{
"FilePath": "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}.csproj",
"NodePath": "ItemGroup",
"Contains": "api_test"
}
]
}
}
}
},
{
"Background": false,
"Name": "WeatherForecast",
"DisplayName": "Do you want to add WeatherForecast controller? Y/N",
"Actions": {
"No": {
"Remove": {
"Directories": [
],
"Files": [
"/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/Controllers/WeatherForecastController.cs"
],
"Lines": [
{
"FilePath": "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}.csproj",
"Contains": ""
},
{
"FilePath": "/src/{ORIG_TEMPLATE_NAME}/{ORIG_TEMPLATE_NAME}.sln",
"Pattern": "(?s)^Project.*?resou.*?^EndProject"
}
]
}
},
"Yes": {
}
}
}
],
"PostAction": {
"RunFile": [
{
"pattern": "*.sln"
}
]
}
}
Troubleshooting
If you encounter any issues while using the Tago Git Template Cloner, consider the following troubleshooting steps:
- Ensure that you have provided the correct repository URL.
- Verify that you have the necessary permissions to clone repositories in your organization.
- Double-check your internet connectivity and ensure that the Git server services are accessible.
If problems persist, please contact our support team at support@tago-solutions.com for further assistance.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- System.Text.Json (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.