I want to grep within the range of changes in Rubymine.

Asked 2 months ago, Updated 2 months ago, 6 views

I would like to grep to the extent that I have changed in the project managed by Git.
You can specify a commit or branch.

I wish I could do it with Rubymine, but in other ways. How are you guys doing it?

git rubymine grep

2022-09-30 11:02

1 Answers

Check it out on the terminal

You can use git log-G<regex> --author=<pattern> in Git 1.7.4 and later.

For this purpose, the following options would be useful:

  • --all
  • --branches[=<pattern>]
  • --tags[=<pattern>]
  • -c—Displays diff.
  • --cc—Shows a short diff.

If you use RubyMine, you can start Terminal on RubyMine and type this command.The Terminal can be found in the search window that starts with Shift-Shift or from the menu "View"→"Tool Windows"→"Terminal".

If you use it many times, setting the alias is useful.

Other Git Commands

  • git log-S<string>—Similar to the -GYou can also add --pickaxe-regex to make it a regular expression.
  • git grep<regexp>$(git rev-list --all --author=<pattern>)—This is how to do the same with another command.If you use it, it will be printed line by line. (See Post to Stack Overflow by Jeet for more information.)

Reference


2022-09-30 11:02

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.