I want to grep a Gemfile in few rails apps. But for each rails app there are many branches and out of which the latest branch name lets say is 'main'.
The structure is something like this:
workspace rails-apps rails-app1 main feature-branch rails-app2 main feature-branch feature-branch2
So I am doing something like this:
grep -R "rails" /workspace/rails-apps/ --include="Gemfile"
but when I do this it greps all the Gemfiles in all the branches which I dont want. I just need to grep only Gemfile in main branch.
Something like this:
grep -R "rails" /workspace/rails-apps/*/main --include="Gemfile"
but it doesnt work.