class Git::Commands::ConfigOptionSyntax::Unset
Remove a single config entry
Wraps ‘git config –unset` to remove the entry matching the given key name and optional value regex.
@example Unset a config key
cmd = Git::Commands::ConfigOptionSyntax::Unset.new(lib) cmd.call('user.name')
@example Unset a global config key
cmd = Git::Commands::ConfigOptionSyntax::Unset.new(lib) cmd.call('user.name', global: true)
@note ‘arguments` block audited against git-scm.com/docs/git-config/2.53.0
@see Git::Commands::ConfigOptionSyntax
@see git-scm.com/docs/git-config git-config documentation
@api private
Public Instance Methods
Source
# File lib/git/commands/config_option_syntax/unset.rb, line 86 def call(*, **) super end
@overload call(name, value_regex = nil, **options)
Execute the `git config --unset` command @param name [String] the config key name to unset @param value_regex [String, nil] (nil) optional regex to match the value to remove @param options [Hash] command options @option options [Boolean, nil] :global (nil) remove from global config (`~/.gitconfig`) @option options [Boolean, nil] :system (nil) remove from system config @option options [Boolean, nil] :local (nil) remove from repository config (`.git/config`) @option options [Boolean, nil] :worktree (nil) remove from worktree config @option options [String] :file (nil) remove from the specified file Alias: :f @option options [String] :blob (nil) read from the specified blob @option options [Boolean, nil] :fixed_value (nil) treat the value regex as an exact string @return [Git::CommandLine::Result] the result of calling `git config --unset` @raise [ArgumentError] if unsupported options are provided @raise [Git::FailedError] if git exits outside the allowed range (exit code > 5) @api public
Calls superclass method
Git::Commands::Base::call