1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-08-23 22:42:27 +01:00
Files
tests
thefuck
rules
__init__.py
apt_get.py
brew_install.py
brew_unknown_command.py
brew_upgrade.py
cargo.py
cargo_no_command.py
cd_correction.py
cd_mkdir.py
cd_parent.py
composer_not_command.py
cp_omitting_directory.py
cpp11.py
django_south_ghost.py
django_south_merge.py
dry.py
fix_alt_space.py
git_add.py
git_branch_delete.py
git_branch_list.py
git_checkout.py
git_diff_staged.py
git_not_command.py
git_pull.py
git_pull_clone.py
git_push.py
git_push_force.py
git_stash.py
go_run.py
grep_recursive.py
has_exists_script.py
history.py
java.py
javac.py
lein_not_task.py
ls_lah.py
man.py
man_no_space.py
mercurial.py
mkdir_p.py
no_command.py
no_such_file.py
open.py
pacman.py
pip_unknown_command.py
python_command.py
python_execute.py
quotation_marks.py
rm_dir.py
rm_root.py
sed_unterminated_s.py
sl_ls.py
ssh_known_hosts.py
sudo.py
switch_lang.py
systemctl.py
test.py.py
tmux.py
whois.py
__init__.py
conf.py
logs.py
main.py
shells.py
types.py
utils.py
.gitignore
.travis.yml
LICENSE.md
MANIFEST.in
README.md
example.gif
release.py
requirements.txt
setup.cfg
setup.py
tox.ini
thefuck/thefuck/rules/git_push_force.py
2015-07-20 18:58:11 +02:00

16 lines
494 B
Python

from thefuck import utils
@utils.git_support
def match(command, settings):
return ('git' in command.script
and 'push' in command.script
and '! [rejected]' in command.stderr
and 'failed to push some refs to' in command.stderr
and 'Updates were rejected because the tip of your current branch is behind' in command.stderr)
@utils.git_support
def get_new_command(command, settings):
return command.script.replace('push', 'push --force')