diff --git a/.gitignore b/.gitignore index b5b7ac7..c865b29 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ var/ *.egg-info/ .installed.cfg *.egg +venv/ # PyInstaller # Usually these files are written by a python script from a template diff --git a/README.md b/README.md index 48b4b0f..484d4e6 100644 --- a/README.md +++ b/README.md @@ -348,6 +348,7 @@ following rules are enabled by default: * `yarn_command_not_found` – fixes misspelled `yarn` commands; * `yarn_command_replaced` – fixes replaced `yarn` commands; * `yarn_help` – makes it easier to open `yarn` documentation; +* `git_merge_mistake` – fixes slash mistake in git merge; ##### [Back to Contents](#contents) diff --git a/thefuck/rules/git-checkout-master-no-git b/thefuck/rules/git-checkout-master-no-git new file mode 100644 index 0000000..394f98e --- /dev/null +++ b/thefuck/rules/git-checkout-master-no-git @@ -0,0 +1,11 @@ +def match(command): + + return ( + command.script == "checkout master" + ) + + + + +def get_new_command(command): + return (command.script.replace("checkout master","git checkout master",1)) diff --git a/thefuck/rules/git-commit-no-git.py b/thefuck/rules/git-commit-no-git.py new file mode 100644 index 0000000..e69de29 diff --git a/thefuck/rules/git-status-no-git.py b/thefuck/rules/git-status-no-git.py new file mode 100644 index 0000000..54bbd3e --- /dev/null +++ b/thefuck/rules/git-status-no-git.py @@ -0,0 +1,11 @@ +def match(command): + + return ( + command.script == "status" + ) + + + + +def get_new_command(command): + return (command.script.replace("status","git status",1)) \ No newline at end of file diff --git a/thefuck/rules/git_add_-a_-A.py b/thefuck/rules/git_add_-a_-A.py new file mode 100644 index 0000000..2df3f23 --- /dev/null +++ b/thefuck/rules/git_add_-a_-A.py @@ -0,0 +1,6 @@ +def match(command): + return command.script == 'git add -a' + + +def get_new_command(command): + return 'git add -A' diff --git a/thefuck/rules/git_add_forgot_git.py b/thefuck/rules/git_add_forgot_git.py new file mode 100644 index 0000000..76d23f9 --- /dev/null +++ b/thefuck/rules/git_add_forgot_git.py @@ -0,0 +1,6 @@ +def match(command): + return command.script == 'add' + + +def get_new_command(command): + return 'git add -A' diff --git a/thefuck/rules/git_init_no_git.py b/thefuck/rules/git_init_no_git.py new file mode 100644 index 0000000..f478654 --- /dev/null +++ b/thefuck/rules/git_init_no_git.py @@ -0,0 +1,11 @@ +def match(command): + + return ( + command.script == "init" + ) + + + + +def get_new_command(command): + return (command.script.replace("init","git init",1)) diff --git a/thefuck/rules/git_merge_originmain_mistake.py b/thefuck/rules/git_merge_originmain_mistake.py new file mode 100644 index 0000000..8cf43a8 --- /dev/null +++ b/thefuck/rules/git_merge_originmain_mistake.py @@ -0,0 +1,8 @@ +def match(command): + return ( + command.script == 'git merge originmain' + ) + + +def get_new_command(command): + return command.script.replace('originmain', 'origin/main', 1) diff --git a/thefuck/rules/git_push_origin_slash_main_mistake.py b/thefuck/rules/git_push_origin_slash_main_mistake.py new file mode 100644 index 0000000..5ae71cb --- /dev/null +++ b/thefuck/rules/git_push_origin_slash_main_mistake.py @@ -0,0 +1,8 @@ +def match(command): + return ( + command.script == "git push origin/main" + ) + + +def get_new_command(command): + return command.script.replace("origin/main", "origin main", 1) \ No newline at end of file