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>.
Install
- All systems
-
curl cmd.cat/git-sed.sh
- Debian
-
apt-get install git-extras
- Ubuntu
-
apt-get install git-extras
- Kali Linux
-
apt-get install git-extras
- Fedora
-
dnf install git-extras
- Windows (WSL2)
-
sudo apt-get update
sudo apt-get install git-extras
- OS X
-
brew install git-extras
- Raspbian
-
apt-get install git-extras
- Dockerfile
- dockerfile.run/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
© tl;dr; authors and contributors