Overview
Learn about Git-Tool's configuration files and how to use them.
Git-Tool uses a yaml configuration file while allows you to configure everything from where your repositories and scratchpads are stored, to which applications you use to open them and which Git hosting services you use to store them.
By default, Git-Tool will attempt to load your configuration from the path provided in your GITTOOL_CONFIG environment variable, however you can override this by passing the --config flag to any Git-Tool command if you wish.
Many config related changes can be conducted using Git-Tool's gt config command, including adding new services and apps, configuring your feature flags and aliasing your commonly used repos.

Directory

The first thing to set up in your config.yml file is your development directory path. This is the directory into which Git-Tool will place your repositories whenever you clone or create them.
Windows
Linux
Mac OS
1
directory: "C:\\Users\\bpannell\\dev"
Copied!
1
directory: "/home/bpannell/dev"
Copied!
1
directory: "/Users/bpannell/dev"
Copied!

Scratchpads

If you plan on using Git-Tool's scratchpads feature, you might decide that you want to place your scratchpads in a different directory to your repositories. Maybe you'd like them to be replicated using your cloud storage service, or maybe you like to live dangerously and want them on a /tmp RAMDisk.
If you don't specify a scratchpads directory, Git-Tool will use a scratch folder within your development directory to hold your scratchpads.
Windows
Linux
Mac OS
1
scratchpads: "C:\\Users\\bpannell\\scratch"
Copied!
1
scratchpads: "/home/bpannell/scratch"
Copied!
1
scratchpads: "/Users/bpannell/scratch"
Copied!

Example Configuration

Here is a short example configuration file which you can use as the basis for your own. You might find the config commands useful to make changes to it.
To view your current configuration, run gt config.
1
---
2
# yaml-language-server: $schema=https://schemas.sierrasoftworks.com/git-tool/v1/config.schema.json
3
$schema: https://schemas.sierrasoftworks.com/git-tool/v1/config.schema.json
4
directory: /home/bpannell/dev
5
services:
6
- domain: github.com
7
website: "https://{{ .Service.Domain }}/{{ .Repo.FullName }}"
8
httpUrl: "https://{{ .Service.Domain }}/{{ .Repo.FullName }}.git"
9
gitUrl: "[email protected]{{ .Service.Domain }}:{{ .Repo.FullName }}.git"
10
pattern: "*/*"
11
- domain: dev.azure.com
12
website: "https://{{ .Service.Domain }}/{{ .Repo.Namespace }}/_git/{{ .Repo.Name }}"
13
httpUrl: "https://{{ .Service.Domain }}/{{ .Repo.Namespace }}/_git/{{ .Repo.Name }}"
14
gitUrl: "[email protected]{{ .Service.Domain }}:v3/{{ .Repo.FullName }}.git"
15
pattern: "*/*/*"
16
apps:
17
- name: shell
18
command: pwsh
19
- name: code
20
command: code
21
args:
22
- .
23
aliases:
24
gt: github.com/SierraSoftworks/git-tool
25
26
features:
27
http_transport: false
28
open_new_repo_in_default_app: true
29
30
# Disable this if you don't want to report crashes to us
31
telemetry: true
Copied!
Last modified 20d ago