Skip to content

dominikschulz/gg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gg - Go Git Grep

Go Git Grep is a small search and replace tool. It works like grep, but is able to replace in files, recursively.

Example

gg '^\s+(.+)\.Log\("level", "(.[^"]+)", ' $GOPATH/src/github.com/dominikschulz/ --exclude vendor/ --workers 20 --replace 'level.${2}(${1}).Log(' --eat-my-data
gg 'level.error\(' $GOPATH/src/github.com/dominikschulz/ --exclude vendor/ --workers 20 --replace 'level.Error(' --eat-my-data --post-proc 'goimports -w'

FAQ

  • Similar tools: grep, ack, the silver searcher, ripgrep
  • Should I use this tool? - Probably not. Use ripgrep or your fancy IDE.
  • Will this tool destroy my data? - Probably yes. At least if you play around with --eat-my-data and --who-needs-backups
  • Seriously? Yes. You should know what you do.
  • Why did you write it then? Because I wanted recursive search and replace, with git support, on Unix platforms without overloaded IDEs.

About

Go Git Grep

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages