From 9ffb83f4b467325b116bc9b04a5db395ed02d6db Mon Sep 17 00:00:00 2001 From: Robson Cruz Date: Mon, 8 Nov 2021 17:59:14 -0300 Subject: [PATCH] git-sed: add page (#7356) --- pages/common/git-sed.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pages/common/git-sed.md diff --git a/pages/common/git-sed.md b/pages/common/git-sed.md new file mode 100644 index 000000000..ab14d9b50 --- /dev/null +++ b/pages/common/git-sed.md @@ -0,0 +1,21 @@ +# git sed + +> Replace patterns in git-controlled files using sed. +> Part of `git-extras`. +> More information: . + +- Replace the specified text in the current repository: + +`git sed '{{find_text}}' '{{replace_text}}'` + +- Replace the specified text and then commit the resulting changes with a standard commit message: + +`git sed -c '{{find_text}}' '{{replace_text}}'` + +- Replace the specified text, using regular expressions: + +`git sed -f g '{{find_text}}' '{{replace_text}}'` + +- Replace a specific text in all files under a given directory: + +`git sed '{{find_text}}' '{{replace_text}}' -- {{path/to/directory}}`