{"version":"2.1.333","anchor":"force-push-warning-regex-now-catches-flags-after-a-newline","canonical_anchor":"force-push-warning-regex-now-catches-flags-after-a-newline","heading":"Force-push warning check rewritten for flags on a following line","tier":"notice","area":"Bash Tool","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/force-push-warning-regex-now-catches-flags-after-a-newline","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### Force-push warning check rewritten for flags on a following line\n\nThe check that warns when a git push uses a force flag was rewritten and still flags a force flag on the line right after `git push`\n\n**What**\n\nWhen Claude Code is about to run a shell command that force-pushes with git, it shows the warning \"Note: may overwrite remote history\". A force push replaces history on the shared remote copy of a repository. The pattern that spots these commands was rewritten.\n\nThe new pattern accepts either a space or a line break followed by spacing before the force flag. These flags count as force flags:\n\n- `--force`\n\n- `--force-with-lease`\n\n- `-f`\n\nA command split across lines, with the force flag on the line directly after `git push ...`, gets the warning. The previous pattern also allowed a line break at that point, so in practice the cases it catches are largely the same as before.\n\n**Why**\n\nThe rewrite makes it explicit that a force flag on a continued line still triggers the warning. You are still warned before history on the remote could be overwritten when a long push command is broken over two lines.\n\n- Area: Bash Tool\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}