Add git_tag_force rule
This adds `--force` to `git tag` when needed. For example:
$ git tag alert
fatal: tag 'alert' already exists
$ fuck
git tag --force alert [enter/↑/↓/ctrl+c]
Updated tag 'alert' (was dec6956)
$
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
from thefuck.utils import replace_argument
|
||||
from thefuck.specific.git import git_support
|
||||
|
||||
|
||||
@git_support
|
||||
def match(command):
|
||||
return ('tag' in command.script_parts
|
||||
and 'already exists' in command.stderr)
|
||||
|
||||
|
||||
@git_support
|
||||
def get_new_command(command):
|
||||
return replace_argument(command.script, 'tag', 'tag --force')
|
||||
Reference in New Issue
Block a user