Git
Work with Git repositories without the git program: init, clone, pull, status, log, diff, add, commit, push, branches, checkout and tags. Typical uses: version files produced by scripts, deploy content from a repository.
git initgit initgit clonegit clonegit pullgit pullgit statusgit loggit loggit diffgit diffgit addgit addgit commitgit commitgit pushgit pushgit branchesgit branchesgit checkoutgit checkoutgit taggit taggit tags

git init <repo_path>


Description

    Create an empty repository with the branch main. Returns {path, bare, branch}

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; -> "[res]" (git init "tmp/tuto_ops/repo"); file delete "tmp/tuto_ops"; [res]
mentdb
{"path": "tmp/tuto_ops/repo", "bare": false, "branch": "main"}

git init <repo_path> <json_params>


Description

    Create a repository with parameters: bare (false), branch (main)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; -> "[res]" (git init "tmp/tuto_ops/origin.git" "{\"bare\": true, \"branch\": \"main\"}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"path": "tmp/tuto_ops/origin.git", "bare": true, "branch": "main"}
Used in use cases (1 recipe)

    System administrator & DevOps › Keep the daily export of a configuration in a Git repository and see what changed
Often used with

    csv write  ·  file delete  ·  file exist  ·  file mkdir  ·  git add  ·  git commit  ·  git diff  ·  git log

git clone <url> <repo_path>


Description

    Clone a repository into an empty or new folder. Returns {path, url (without user), bare, branch, head}. On failure the folder is removed

Parameters

    url:   The URL or local folder of the repository - String - required
    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; -> "[res]" (git clone "tmp/tuto_ops/repo" "tmp/tuto_ops/copy"); file delete "tmp/tuto_ops"; [res]
mentdb
{"path": "tmp/tuto_ops/copy", "url": "tmp/tuto_ops/repo", "bare": false, "branch": "main", "head": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af"}

git clone <url> <repo_path> <json_params>


Description

    Clone with parameters: branch, bare (false), no_checkout (false) and the network parameters (see the top of the page)

Parameters

    url:   The URL - String - required
    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; -> "[res]" (git clone "tmp/tuto_ops/repo" "tmp/tuto_ops/mirror.git" "{\"branch\": \"main\", \"bare\": true}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"path": "tmp/tuto_ops/mirror.git", "url": "tmp/tuto_ops/repo", "bare": true, "branch": "main", "head": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af"}
Fixed result from a real call on a local Git HTTP server with Basic authentication (host name replaced): clone over https with a token held by the secret GIT_TOKEN
admin
git clone "https://git.example.com/team/scripts.git" "tmp/scripts" "{\"token\": \"git_token\", \"branch\": \"main\"}"
mentdb
{"path": "tmp/scripts", "url": "https://git.example.com/team/scripts.git", "bare": false, "branch": "main", "head": "4e23147fdf64aba751ef88581708d0790809463d"}
Fixed result from a real call on a local SSH Git server (host name replaced): clone with a key protected by a passphrase and a known_hosts file
admin
git clone "ssh://git@git.example.com/team/scripts.git" "tmp/scripts" "{\"key_path\": \"conf/keys/id_ed25519\", \"passphrase\": \"git_key_pass\", \"known_hosts\": \"conf/keys/known_hosts\", \"branch\": \"main\"}"
mentdb
{"path": "tmp/scripts", "url": "ssh://git.example.com/team/scripts.git", "bare": false, "branch": "main", "head": "4e23147fdf64aba751ef88581708d0790809463d"}

git pull <repo_path>


Description

    Fetch the remote origin and merge its branch into the current branch. Returns {successful, fetched_from, merge_status (fast_forward, already_up_to_date, merged, conflicting...), conflicts, head}

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; git clone "tmp/tuto_ops/repo" "tmp/tuto_ops/copy"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}, {\"id\": 2, \"amount\": 75.5}]"; git add "tmp/tuto_ops/repo" "."; git commit "tmp/tuto_ops/repo" "Order 2" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T09:00:00Z\"}"; -> "[res]" (git pull "tmp/tuto_ops/copy"); file delete "tmp/tuto_ops"; [res]
mentdb
{"successful": true, "fetched_from": "origin", "merge_status": "fast_forward", "conflicts": [], "head": "2966a7aa8346a005660b670ea19bf1c45627375c"}

git pull <repo_path> <json_params>


Description

    Pull with parameters: remote (origin), branch (the remote branch to merge) and the network parameters

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; git clone "tmp/tuto_ops/repo" "tmp/tuto_ops/copy"; -> "[res]" (git pull "tmp/tuto_ops/copy" "{\"remote\": \"origin\", \"branch\": \"main\"}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"successful": true, "fetched_from": "origin", "merge_status": "already_up_to_date", "conflicts": [], "head": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af"}

git status <repo_path>


Description

    The state of the working tree: {branch, head, clean, added, changed, removed, modified, missing, untracked, conflicting} (added, changed, removed: in the index; modified, missing: not added yet)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 130}]"; csv write "tmp/tuto_ops/repo/new.csv" "[{\"a\": 1}]"; -> "[res]" (git status "tmp/tuto_ops/repo"); file delete "tmp/tuto_ops"; [res]
mentdb
{"branch": "main", "head": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "clean": false, "added": [], "changed": [], "removed": [], "modified": ["orders.csv"], "missing": [], "untracked": ["new.csv"], "conflicting": []}
Used in use cases (1 recipe)

    System administrator & DevOps › Keep the daily export of a configuration in a Git repository and see what changed
Often used with

    csv write  ·  file delete  ·  file exist  ·  file mkdir  ·  git add  ·  git commit  ·  git diff  ·  git init

git log <repo_path>


Description

    The 50 last commits from HEAD: JSON array of {id, short_id, author, email, date, message, parents}

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}, {\"id\": 2, \"amount\": 75.5}]"; git add "tmp/tuto_ops/repo" "."; git commit "tmp/tuto_ops/repo" "Order 2" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T09:00:00Z\"}"; -> "[res]" (git log "tmp/tuto_ops/repo"); file delete "tmp/tuto_ops"; [res]
mentdb
[{"id": "2966a7aa8346a005660b670ea19bf1c45627375c", "short_id": "2966a7a", "author": "Ann Martin", "email": "ann@example.com", "date": "2026-11-10T09:00:00Z", "message": "Order 2", "parents": ["e6f3aedc3b4975b9a9c39500376dd0bc977ea7af"]}, {"id": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "short_id": "e6f3aed", "author": "Ann Martin", "email": "ann@example.com", "date": "2026-11-10T08:00:00Z", "message": "First orders", "parents": []}]

git log <repo_path> <json_params>


Description

    The commits with parameters: limit (50, up to 100000), path (only the commits that change this file or folder), from (a commit, branch or tag), all (true: every branch)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}, {\"id\": 2, \"amount\": 75.5}]"; git add "tmp/tuto_ops/repo" "."; git commit "tmp/tuto_ops/repo" "Order 2" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T09:00:00Z\"}"; -> "[res]" (git log "tmp/tuto_ops/repo" "{\"limit\": 1, \"path\": \"orders.csv\"}"); file delete "tmp/tuto_ops"; [res]
mentdb
[{"id": "2966a7aa8346a005660b670ea19bf1c45627375c", "short_id": "2966a7a", "author": "Ann Martin", "email": "ann@example.com", "date": "2026-11-10T09:00:00Z", "message": "Order 2", "parents": ["e6f3aedc3b4975b9a9c39500376dd0bc977ea7af"]}]
Used in use cases (1 recipe)

    System administrator & DevOps › Keep the daily export of a configuration in a Git repository and see what changed
Often used with

    csv write  ·  file delete  ·  file exist  ·  file mkdir  ·  git add  ·  git commit  ·  git diff  ·  git init

git diff <repo_path>


Description

    The changes of the working tree not added yet, as the unified text of git diff (files never added are not shown)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 130}]"; -> "[res]" (git diff "tmp/tuto_ops/repo"); file delete "tmp/tuto_ops"; [res]
mentdb
diff --git a/orders.csv b/orders.csv index 8b3fcb1..29f6e00 100644 --- a/orders.csv +++ b/orders.csv @@ -1,2 +1,2 @@ id,amount -1,120 +1,130

git diff <repo_path> <json_params>


Description

    The changes with parameters: from and to (two commits: like git diff from to), from alone (a commit against the working tree), cached (true: the index against HEAD or from, like git diff --cached), path (one file or folder), context (3 lines)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}, {\"id\": 2, \"amount\": 75.5}]"; git add "tmp/tuto_ops/repo" "."; git commit "tmp/tuto_ops/repo" "Order 2" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T09:00:00Z\"}"; -> "[res]" (git diff "tmp/tuto_ops/repo" "{\"from\": \"HEAD~1\", \"to\": \"HEAD\"}"); file delete "tmp/tuto_ops"; [res]
mentdb
diff --git a/orders.csv b/orders.csv index 8b3fcb1..645d1e1 100644 --- a/orders.csv +++ b/orders.csv @@ -1,2 +1,3 @@ id,amount 1,120 +2,75.5
Used in use cases (1 recipe)

    System administrator & DevOps › Keep the daily export of a configuration in a Git repository and see what changed
Often used with

    csv write  ·  file delete  ·  file exist  ·  file mkdir  ·  git add  ·  git commit  ·  git init  ·  git log

git add <repo_path> <patterns>


Description

    Add files to the index: a pattern (a file, a folder, or . for everything) or a JSON array of patterns, relative to the repository. Returns {added, changed, removed} of the index

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    patterns:   A pattern or a JSON array of patterns - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/a.csv" "[{\"x\": 1}]"; csv write "tmp/tuto_ops/repo/b.csv" "[{\"x\": 2}]"; -> "[res]" (git add "tmp/tuto_ops/repo" "[\"a.csv\", \"b.csv\"]"); file delete "tmp/tuto_ops"; [res]
mentdb
{"added": ["a.csv", "b.csv"], "changed": [], "removed": []}

git add <repo_path> <patterns> <json_params>


Description

    Add files with parameters: update (true: only the files already tracked, deletions included, like git add -u)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    patterns:   A pattern or a JSON array of patterns - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 130}]"; csv write "tmp/tuto_ops/repo/new.csv" "[{\"a\": 1}]"; -> "[res]" (git add "tmp/tuto_ops/repo" "." "{\"update\": true}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"added": [], "changed": ["orders.csv"], "removed": []}
Used in use cases (1 recipe)

    System administrator & DevOps › Keep the daily export of a configuration in a Git repository and see what changed
Often used with

    csv write  ·  file delete  ·  file exist  ·  file mkdir  ·  git commit  ·  git diff  ·  git init  ·  git log

git commit <repo_path> <message>


Description

    Commit the index with the author of the Git configuration (user.name and user.email); an error when they are not set or when there is nothing to commit. Returns the commit as git log and the branch

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    message:   The message - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/a.csv" "[{\"x\": 1}]"; git add "tmp/tuto_ops/repo" "."; try {-> "[res]" (git commit "tmp/tuto_ops/repo" "Data of the day");} {-> "[res]" [err];} "[err]"; file delete "tmp/tuto_ops"; [res]
mentdb
line 1 >>> -> [res] "git commit \"tmp/tuto_ops/repo\" \"Data of the day\";" ; line 1 >>> git commit tmp/tuto_ops/repo "Data of the day" ; [[[ Sorry, an error appears (give the parameters 'author_name' and 'author_email' (user.name and user.email are not set in the Git configuration)). ]]]

git commit <repo_path> <message> <json_params>


Description

    Commit with parameters: author_name, author_email, date (ISO date with a zone: the date of the commit, for reproducible ids), all (true: add the modified tracked files first, like git commit -a), allow_empty (false)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    message:   The message - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; -> "[res]" (git commit "tmp/tuto_ops/repo" "First orders, imported from the shop" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"id": "453be0e397033b22b61c1e71eb7d031637f7402f", "short_id": "453be0e", "author": "Ann Martin", "email": "ann@example.com", "date": "2026-11-10T08:00:00Z", "message": "First orders, imported from the shop", "parents": [], "branch": "main"}
Used in use cases (1 recipe)

    System administrator & DevOps › Keep the daily export of a configuration in a Git repository and see what changed
Often used with

    csv write  ·  file delete  ·  file exist  ·  file mkdir  ·  git add  ·  git diff  ·  git init  ·  git log

git push <repo_path>


Description

    Push the current branch to origin (same branch name). Returns an array of {ref, status (ok, up_to_date, rejected_nonfastforward...), new_id, message}

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/origin.git" "{\"bare\": true}"; git clone "tmp/tuto_ops/origin.git" "tmp/tuto_ops/work"; csv write "tmp/tuto_ops/work/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/work" "."; git commit "tmp/tuto_ops/work" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; -> "[res]" (git push "tmp/tuto_ops/work"); file delete "tmp/tuto_ops"; [res]
mentdb
[{"ref": "refs/heads/main", "status": "ok", "new_id": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "message": null}]

git push <repo_path> <json_params>


Description

    Push with parameters: remote (origin), branch (one branch), all (every branch), tags (the tags too), force (false) and the network parameters

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/origin.git" "{\"bare\": true}"; git clone "tmp/tuto_ops/origin.git" "tmp/tuto_ops/work"; csv write "tmp/tuto_ops/work/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/work" "."; git commit "tmp/tuto_ops/work" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; git tag "tmp/tuto_ops/work" "v1"; -> "[res]" (git push "tmp/tuto_ops/work" "{\"branch\": \"main\", \"tags\": true}"); file delete "tmp/tuto_ops"; [res]
mentdb
[{"ref": "refs/heads/main", "status": "ok", "new_id": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "message": null}, {"ref": "refs/tags/v1", "status": "ok", "new_id": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "message": null}]

git branches <repo_path>


Description

    The local branches: array of {name, id, current}

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; git checkout "tmp/tuto_ops/repo" "fix-amounts" "{\"create\": true}"; -> "[res]" (git branches "tmp/tuto_ops/repo"); file delete "tmp/tuto_ops"; [res]
mentdb
[{"name": "fix-amounts", "id": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "current": true}, {"name": "main", "id": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "current": false}]

git branches <repo_path> <json_params>


Description

    The branches with parameters: remote (true: the remote branches, origin/...)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; git clone "tmp/tuto_ops/repo" "tmp/tuto_ops/copy"; -> "[res]" (git branches "tmp/tuto_ops/copy" "{\"remote\": true}"); file delete "tmp/tuto_ops"; [res]
mentdb
[{"name": "origin/main", "id": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "current": false}]

git checkout <repo_path> <name>


Description

    Switch to a branch, or to a commit or tag (detached). Returns {branch, head, detached}. Local changes that would be overwritten stop the call

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    name:   The branch, tag or commit - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}, {\"id\": 2, \"amount\": 75.5}]"; git add "tmp/tuto_ops/repo" "."; git commit "tmp/tuto_ops/repo" "Order 2" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T09:00:00Z\"}"; -> "[res]" (git checkout "tmp/tuto_ops/repo" "HEAD~1"); file delete "tmp/tuto_ops"; [res]
mentdb
{"branch": null, "head": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "detached": true}

git checkout <repo_path> <name> <json_params>


Description

    Switch with parameters: create (true: a new branch), start_point (the commit of the new branch), force (true: local changes are lost)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    name:   The branch - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}, {\"id\": 2, \"amount\": 75.5}]"; git add "tmp/tuto_ops/repo" "."; git commit "tmp/tuto_ops/repo" "Order 2" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T09:00:00Z\"}"; -> "[res]" (git checkout "tmp/tuto_ops/repo" "hotfix" "{\"create\": true, \"start_point\": \"HEAD~1\"}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"branch": "hotfix", "head": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "detached": false}

git tag <repo_path> <name>


Description

    Create a lightweight tag on HEAD. Returns {name, id, annotated, target}

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    name:   The tag name - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; -> "[res]" (git tag "tmp/tuto_ops/repo" "v1.0"); file delete "tmp/tuto_ops"; [res]
mentdb
{"name": "v1.0", "id": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "annotated": false, "target": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af"}

git tag <repo_path> <name> <json_params>


Description

    Create a tag with parameters: message (an annotated tag), tagger_name and tagger_email (or the Git configuration), date (ISO date of an annotated tag), commit (HEAD by default), force (replace an existing tag)

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
    name:   The tag name - String - required
    json_params:   The parameters - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}, {\"id\": 2, \"amount\": 75.5}]"; git add "tmp/tuto_ops/repo" "."; git commit "tmp/tuto_ops/repo" "Order 2" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T09:00:00Z\"}"; -> "[res]" (git tag "tmp/tuto_ops/repo" "v0.9" "{\"message\": \"Before order 2\", \"commit\": \"HEAD~1\", \"tagger_name\": \"Ann Martin\", \"tagger_email\": \"ann@example.com\", \"date\": \"2026-11-10T10:00:00Z\"}"); file delete "tmp/tuto_ops"; [res]
mentdb
{"name": "v0.9", "id": "1b44f27b07dc51f49e11fe6d912ecb38779765df", "annotated": true, "target": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af"}
Used in use cases (1 recipe)

    System administrator & DevOps › Keep the daily export of a configuration in a Git repository and see what changed
Often used with

    csv write  ·  file delete  ·  file exist  ·  file mkdir  ·  git add  ·  git commit  ·  git diff  ·  git init

git tags <repo_path>


Description

    The tags: array of {name, id, annotated, target (the commit), message}

Parameters

    repo_path:   The folder of the repository (working tree, or bare repository) - String - required
admin
if (equal (file exist "tmp/tuto_ops") "0") {file mkdir "tmp/tuto_ops";}; git init "tmp/tuto_ops/repo"; csv write "tmp/tuto_ops/repo/orders.csv" "[{\"id\": 1, \"amount\": 120}]"; git add "tmp/tuto_ops/repo" "orders.csv"; git commit "tmp/tuto_ops/repo" "First orders" "{\"author_name\": \"Ann Martin\", \"author_email\": \"ann@example.com\", \"date\": \"2026-11-10T08:00:00Z\"}"; git tag "tmp/tuto_ops/repo" "v1.0"; -> "[res]" (git tags "tmp/tuto_ops/repo"); file delete "tmp/tuto_ops"; [res]
mentdb
[{"name": "v1.0", "id": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "annotated": false, "target": "e6f3aedc3b4975b9a9c39500376dd0bc977ea7af", "message": null}]