mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-05 12:45:59 +02:00
git-sed: add page (#7356)
This commit is contained in:
parent
49265db659
commit
9ffb83f4b4
1 changed files with 21 additions and 0 deletions
21
pages/common/git-sed.md
Normal file
21
pages/common/git-sed.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# git sed
|
||||
|
||||
> Replace patterns in git-controlled files using sed.
|
||||
> Part of `git-extras`.
|
||||
> More information: <https://github.com/tj/git-extras/blob/master/Commands.md#git-sed>.
|
||||
|
||||
- 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}}`
|
Loading…
Add table
Reference in a new issue