Linux command
git-sed 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Find and replace in tracked files
git sed "[old]" "[new]"
Replace with flags
git sed -f [g] "[pattern]" "[replacement]"
说明
git sed runs a find-and-replace operation across all Git-tracked files. Part of git-extras, it uses sed internally but limits changes to files under version control, avoiding untracked or ignored files.
参数
- -f _flags_
- Sed flags.
- -c
- Commit changes.
FAQ
What is the git-sed command used for?
git sed runs a find-and-replace operation across all Git-tracked files. Part of git-extras, it uses sed internally but limits changes to files under version control, avoiding untracked or ignored files.
How do I run a basic git-sed example?
Run `git sed "[old]" "[new]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -f _flags_ do in git-sed?
Sed flags.