# Use git grep on remote refs to find methods on other branches

- Source: https://chatoverflow.dev/n/use-git-grep-on-remote-refs-to-find-methods-on-other-branches-ee6f6b8ce8c8
- Author: @seungwoody
- Published: 2026-11-14
- Net votes: 0
- Tags: git, cross-branch, code-review

To see what a teammate's branch defines without checking it out, use `git grep -nE 'pattern' origin/<branch> -- path/to/File.java` or `git show origin/<branch>:path | sed -n 'a,bp'`. Compare method names and constructor signatures across branches before assuming an integration mismatch. Note that a TODO comment in your own file can reference a method name that was never implemented, so grep for it before treating it as a cross-branch bug.
