id = "git" name = "Git" homepage = "https://git-scm.com" description = "Distributed version control, built for speed and cheap branching." icon = "theSVG:git" executables = ["git"] [dotfiles] # git-config(1): the per-user file is $XDG_CONFIG_HOME/git/config and # ~/.gitconfig; gitignore(5) and gitattributes(5) name the other two. paths = [ "~/.gitconfig", "~/.config/git/config", "~/.config/git/ignore", "~/.config/git/attributes", ] exclude = [] # git-credential-store(1) writes plaintext credentials to these two files. secret = ["~/.git-credentials", "~/.config/git/credentials"] side_effect = true # Matched against the file as written, not against `git config --list` # output: inside [user] / [credential] the keys appear bare, so the prefix is # `signingkey` and `helper`, not `user.signingkey` / `credential.helper`. # # Both per-user files, because git merges them rather than picking one: a # machine can keep [user] in ~/.gitconfig and [pull] in the XDG file, or the # other way round. Naming only ~/.gitconfig would sync a signing key that # happens to live in the other half. The two names share no last segment, so # the sibling check cannot pair them — this list is by hand. # # signingkey names the key this machine signs with — a GPG key id, or the ssh # public key itself. The key does not travel, but which one the user signs # with is the first thing they would have to set up again here, so it is kept: # backup. [[dotfiles.machine_lines]] file = ["~/.gitconfig", "~/.config/git/config"] match = { prefix = ["signingkey"] } scope = "backup" # helper is split out of the rule above because the platform picks it, not the # user: osxkeychain on a Mac, manager or wincred on Windows, libsecret on a # distro. Every box of the same kind wants the same helper, so the line travels # to one of those. [[dotfiles.machine_lines]] file = ["~/.gitconfig", "~/.config/git/config"] match = { prefix = ["helper"] } scope = "platform" [commands] format = 1 label = "Git" description = "Common Git jobs: commit, clone, status, push and pull. Rebase, merge, stash and the rest of Git are left out." quality = "ai-draft" base = "fig:git" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/git.ts" license = "MIT" [[commands.subcommand]] path = ["commit"] label = "Commit changes" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/git.ts" license = "MIT" [[commands.subcommand.field]] id = "message" label = "Message" type = "string" option = ["--message", "-m"] sources = ["fig"] [[commands.subcommand.field]] id = "all" label = "Stage all modified and deleted files" type = "boolean" option = ["--all", "-a"] sources = ["fig"] [[commands.subcommand.field]] id = "amend" label = "Amend previous commit" description = "Replaces the tip of the current branch." type = "boolean" option = ["--amend"] effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "signoff" label = "Add Signed-off-by" type = "boolean" option = ["--signoff", "-s"] sources = ["fig"] [[commands.subcommand.field]] id = "no_verify" label = "Skip pre-commit and commit-msg hooks" type = "boolean" option = ["--no-verify", "-n"] sources = ["fig"] [[commands.subcommand.field]] id = "allow_empty" label = "Allow empty commit" type = "boolean" option = ["--allow-empty"] sources = ["fig"] [[commands.subcommand.field]] id = "dry_run" label = "Dry run" type = "boolean" option = ["--dry-run"] sources = ["fig"] [[commands.subcommand.field]] id = "no_edit" label = "Keep message without editor" type = "boolean" option = ["--no-edit"] sources = ["fig"] [[commands.subcommand.field]] id = "author" label = "Author override" type = "string" option = ["--author"] sources = ["fig"] [[commands.subcommand.field]] id = "pathspec" label = "Paths" type = "path" position = 0 multiple = true path = { kind = "any", role = "input" } sources = ["fig"] [[commands.subcommand.task]] id = "commit-all" label = "Commit all with message" set = { all = [true] } fields = ["message", "all"] required = ["message"] [[commands.subcommand.task]] id = "amend-no-edit" label = "Amend, keep message" set = { amend = [true], no_edit = [true] } fields = ["amend", "no_edit"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["message", "all", "amend"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["signoff", "no_verify", "allow_empty", "dry_run", "no_edit", "author", "pathspec"] [[commands.subcommand]] path = ["clone"] label = "Clone a repository" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/git.ts" license = "MIT" [[commands.subcommand.field]] id = "repository" label = "Repository URL" type = "string" position = 0 sources = ["fig"] [[commands.subcommand.field]] id = "directory" label = "Directory" type = "path" position = 1 path = { kind = "any", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "branch" label = "Branch" type = "string" option = ["--branch", "-b"] sources = ["fig"] [[commands.subcommand.field]] id = "depth" label = "Shallow depth" type = "integer" option = ["--depth"] sources = ["fig"] [[commands.subcommand.field]] id = "single_branch" label = "Single branch only" type = "boolean" option = ["--single-branch"] sources = ["fig"] [[commands.subcommand.field]] id = "bare" label = "Bare repository" type = "boolean" option = ["--bare"] sources = ["fig"] [[commands.subcommand.field]] id = "no_tags" label = "Skip tags" type = "boolean" option = ["--no-tags"] sources = ["fig"] [[commands.subcommand.field]] id = "quiet" label = "Quiet" type = "boolean" option = ["--quiet", "-q"] sources = ["fig"] [[commands.subcommand.task]] id = "clone" label = "Clone" fields = ["repository", "directory", "branch"] required = ["repository"] [[commands.subcommand.task]] id = "shallow" label = "Shallow clone" set = { depth = [1], single_branch = [true] } fields = ["repository", "directory", "depth", "single_branch"] required = ["repository"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["repository", "directory"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["branch", "depth", "single_branch", "bare", "no_tags", "quiet"] [[commands.subcommand]] path = ["status"] label = "Show status" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/git.ts" license = "MIT" [[commands.subcommand.field]] id = "short" label = "Short format" type = "boolean" option = ["--short", "-s"] sources = ["fig"] [[commands.subcommand.field]] id = "branch" label = "Show branch" type = "boolean" option = ["--branch", "-b"] sources = ["fig"] [[commands.subcommand.field]] id = "show_stash" label = "Show stash" type = "boolean" option = ["--show-stash"] sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbose" type = "boolean" option = ["--verbose", "-v"] sources = ["fig"] [[commands.subcommand.field]] id = "porcelain" label = "Porcelain" type = "boolean" option = ["--porcelain"] sources = ["fig"] [[commands.subcommand.task]] id = "status" label = "Short status" set = { short = [true], branch = [true] } fields = ["short", "branch"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["short", "branch"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["show_stash", "verbose", "porcelain"] [[commands.subcommand]] path = ["push"] label = "Push to a remote" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/git.ts" license = "MIT" [[commands.subcommand.field]] id = "remote" label = "Remote" type = "string" position = 0 suggestions = [{ value = "origin", label = "origin" }] sources = ["fig"] [[commands.subcommand.field]] id = "branch" label = "Branch" type = "string" position = 1 sources = ["fig"] [[commands.subcommand.field]] id = "set_upstream" label = "Set upstream" type = "boolean" option = ["--set-upstream", "-u"] sources = ["fig"] [[commands.subcommand.field]] id = "tags" label = "Push tags" type = "boolean" option = ["--tags"] sources = ["fig"] [[commands.subcommand.field]] id = "dry_run" label = "Dry run" type = "boolean" option = ["--dry-run", "-n"] sources = ["fig"] [[commands.subcommand.field]] id = "force_with_lease" label = "Force with lease" description = "Overwrites remote history if the remote ref is where you expect." type = "boolean" option = ["--force-with-lease"] effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "force" label = "Force" description = "Overwrites remote history." type = "boolean" option = ["--force", "-f"] effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "delete" label = "Delete remote ref" type = "boolean" option = ["--delete", "-d"] effect = "delete" sources = ["fig"] [[commands.subcommand.field]] id = "no_verify" label = "Skip pre-push hook" type = "boolean" option = ["--no-verify"] sources = ["fig"] [[commands.subcommand.task]] id = "push-upstream" label = "Push and set upstream" set = { set_upstream = [true], remote = ["origin"] } fields = ["remote", "branch", "set_upstream"] required = ["remote", "branch"] [[commands.subcommand.task]] id = "dry-run" label = "Preview push" set = { dry_run = [true] } fields = ["remote", "branch", "dry_run"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["remote", "branch", "set_upstream"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["tags", "dry_run", "force_with_lease", "force", "delete", "no_verify"] [[commands.subcommand]] path = ["pull"] label = "Pull from a remote" [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/git.ts" license = "MIT" [[commands.subcommand.field]] id = "remote" label = "Remote" type = "string" position = 0 suggestions = [{ value = "origin", label = "origin" }] sources = ["fig"] [[commands.subcommand.field]] id = "branch" label = "Branch" type = "string" position = 1 sources = ["fig"] [[commands.subcommand.field]] id = "ff_only" label = "Fast-forward only" type = "boolean" option = ["--ff-only"] sources = ["fig"] [[commands.subcommand.field]] id = "no_ff" label = "Always create merge commit" type = "boolean" option = ["--no-ff"] sources = ["fig"] [[commands.subcommand.field]] id = "no_commit" label = "Do not commit the merge" type = "boolean" option = ["--no-commit"] sources = ["fig"] [[commands.subcommand.task]] id = "ff-only" label = "Fast-forward pull" set = { ff_only = [true] } fields = ["remote", "branch", "ff_only"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["remote", "branch", "ff_only"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["no_ff", "no_commit"]