diff --git a/.gitignore b/.gitignore index b5b7ac739..c865b29fd 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 3ea406fcf..ebbcce3d5 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 000000000..394f98e3a --- /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 000000000..e69de29bb diff --git a/thefuck/rules/git-status-no-git.py b/thefuck/rules/git-status-no-git.py new file mode 100644 index 000000000..54bbd3e8d --- /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 000000000..2df3f236a --- /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 000000000..76d23f9d2 --- /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 000000000..f47865472 --- /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 000000000..8cf43a87f --- /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 000000000..5ae71cb0f --- /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